2014-02-17 108 views
1

我使用GitHub上,當我git branch -a,就這樣表示:刪除通過「git的分支-a」本地顯示的遠程分支

master 
* develop 
    remotes/origin/HEAD 
    remotes/origin/develop 
    remotes/origin/master 
    remotes/origin/feature001 
    remotes/origin/feature002 
    remotes/origin/feature003 

我已刪除feature001上GitHub.com〜003,如何我可以在本地刪除它們嗎?我的意思是當我做git branch -a時不顯示。

回答

2

一般而言,您應該運行git fetch -p(或--prune,意思相同)。但是,有一個錯誤(正在修復),有時需要運行git remote --prune來代替;見this question and answers

(如果必要的話,你可以通過使用git update-ref -d用全名,或編輯底層的Git倉庫的文件和目錄手動刪除它們。)