2013-08-29 121 views
16

我有點難以刪除本地ref分支(refs/notes/origin/commits)。 我能夠刪除分支(裁判/筆記/產地/提交)在遠程倉庫使用命令git:如何刪除本地ref分支?

git push origin :refs/notes/origin/commits 

,但是當我試圖刪除我的本地庫在同一分支,我得到下面的錯誤

[[email protected] Clone]# git branch -rd refs/notes/origin/commits 
error: remote branch 'refs/notes/origin/commits' not found. 

有什麼建議嗎?

回答

34

只是做

git branch -d commits 

刪除本地分支。

使用-D開關將其刪除,而不考慮其合併狀態。

使用

git update-ref -d refs/notes/origin/commits 

刪除裁判。

你也可以在其他的答案中提到有

rm -rf .git/refs/notes 
+1

與git分支你不能刪除筆記... – silvio

+0

真的,謝謝你的提示。更新了我的答案。 – akluth

+0

謝謝大家.. :) – Iowa

1

你可以刪除文件了.git目錄的硬刪除。從版本庫的根,這樣的命令會得到它:

rm .git/refs/tags/refs/original/refs/heads/master 

的路徑可能會稍有不同,如果通過git-tag命令失敗了,所以你可能要到CD的.git /裁判並找到有問題的頭試驗和錯誤。刪除文件將從本地存儲庫中刪除引用。

5

你有筆記在你自己的Git倉庫,你可以刪除一個注意到

git notes remove <commit> 

刪除所有的筆記,你必須刪除「註釋」目錄

rm -rf .git/refs/notes 

,或者您可以使用git update-ref命令。

git update-ref -d refs/notes/commits