2017-03-20 38 views
1

我正在從上游回購協議處理分支。本地我在分支foo。我將foo推到GitHub的回購站上,並將upstream/master公開並將其合併。刪除遠程分支時的GitHub流程

合併之後,我刪除了在GitHub上的foo分支和當地也:

git branch -d foo 

但如果我認爲我的日誌有:

git log --graph --pretty=oneline --abbrev-commit --decorate --all 

然後,我仍然看到origin/foo

another answer閱讀使用方法:

git remote prune origin 

成功地刪除origin/foo

  • 這是刪除功能分支時正確的GitHub工作流嗎?

過程:

delete branch on GitHub -> delete branch locally -> prune the origin 

回答

1

是的,這是一個可能的工作流程,並且可以設置(因爲Git的1.8.5):

git config remote.origin.prune true 

這樣,一個簡單的git fetch足夠。

Another approach是在本地刪除,然後把該刪除:

$ git push origin --delete <branch_name> 
$ git branch -d <branch_name>