亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to delete remote branch in git
世界只因有你
世界只因有你 2017-05-02 09:51:33
0
4
945

Deleting the remote branch failed. How to delete the remote branch?

世界只因有你
世界只因有你

reply all(4)
曾經(jīng)蠟筆沒有小新

Isn’t it written that there is no "new" branch on the remote server? Has it been deleted by someone else?

Remove local tracking

#Deleting a local remote-tracking branch:
git branch --delete --remotes <remote>/<branch>
git branch -dr <remote>/<branch> # Shorter
世界只因有你
刪除遠(yuǎn)程分支和tag

在Git v1.7.0 之后,可以使用這種語法刪除遠(yuǎn)程分支:

$ git push origin --delete <branchName>
刪除tag這么用:

git push origin --delete tag <tagname>

否則,可以使用這種語法,推送一個空分支到遠(yuǎn)程分支,其實就相當(dāng)于刪除遠(yuǎn)程分支:

git push origin :<branchName>
這是刪除tag的方法,推送一個空tag到遠(yuǎn)程tag:

git tag -d <tagname>
git push origin :refs/tags/<tagname>
兩種語法作用完全相同。

刪除不存在對應(yīng)遠(yuǎn)程分支的本地分支

假設(shè)這樣一種情況:

我創(chuàng)建了本地分支b1并pull到遠(yuǎn)程分支 origin/b1;
其他人在本地使用fetch或pull創(chuàng)建了本地的b1分支;
我刪除了 origin/b1 遠(yuǎn)程分支;
其他人再次執(zhí)行fetch或者pull并不會刪除這個他們本地的 b1 分支,運行 git branch -a 也不能看出這個branch被刪除了,如何處理?
使用下面的代碼查看b1的狀態(tài):

$ git remote show origin
* remote origin
  Fetch URL: git@github.com:xxx/xxx.git
  Push  URL: git@github.com:xxx/xxx.git
  HEAD branch: master
  Remote branches:
    master                 tracked
    refs/remotes/origin/b1 stale (use 'git remote prune' to remove)
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)
這時候能夠看到b1是stale的,使用 git remote prune origin 可以將其從本地版本庫中去除。

更簡單的方法是使用這個命令,它在fetch之后刪除掉沒有與遠(yuǎn)程分支對應(yīng)的本地分支:

git fetch -p

http://zengrong.net/post/1746...

巴扎黑

To play git, I recommend you read the blogs of two people, one is Liao Xuefeng and Liao Xuefeng’s git tutorial

The second one is Ruan Yifeng, Ruan Yifeng git tutorial

僅有的幸福

Indicates that the remote branch corresponding to this branch is in stale status and synchronizes the local repository. Command:
git remote update origin --prunegit remote update origin --prune
git pull -pgit pull -p I usually use this
But you have to manually delete the branch locally.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template