2013-08-29 894 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