關於遠程分支的一些操作
本地分支與鹽城分支對應的關系
git branch -av
git remote show 遠程的別名(如:origin)
顯示結果:
soaeon@DESKTOP-FUJJTHR MINGW64 /f/gitstudy (master)
$ git branch -av
* master ecb331a update
remotes/gitlab/dev 57ff052 dev first commit
remotes/gitlab/develop ecb331a update
remotes/gitlab/master ecb331a update
添加遠程分支參
git remote add 顯示名字 項目ssh地址
比如:
git remote add gitlab git@git.xxoo.com:dotnet/basics/gitstudy.git
刪除遠程分支(github/gitlab中的這個分支也會被刪除掉)
git push gitlab --delete fix_bug
gitlab 是上面為ssh地址取得名字。
fix_bug 是分支名字
刪除本地得分支
git branch -d 分支名字
清理遠程已經刪除, 但是本地還存在的分支
清理遠程已刪除本地還存在的分支 git fetch --prune origin 或者 git fetch -p 或者 git pull -p