我想从中央git存储库中删除远程分支。通常的建议是'git push origin:branchname'或'git push origin:heads/branchname'。但是当我尝试的时候,我得到这个错误信息:无法删除git中的远程分支
*** Deleting a branch is not allowed in this repository
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/branchname
To /opt/repo/myrepo.git
! [remote rejected] branchname (hook declined)
error: failed to push some refs to '/opt/repo/myrepo.git'
什么给?如果有帮助,我使用git版本1.5.4.3。
谢谢!有了这些信息,我可以解决这个问题:'git --git-dir /opt/repo/myrepo.git config --bool hooks.allowdeletebranch true'。做完这些之后,我可以使用'git push origin:branchname'来删除远程分支。 – twirlip 2010-02-05 03:27:04
@twirlip:太棒了,很高兴你能够修复它。 – ebneter 2010-02-05 06:08:46
我低估了答案,因为它提供了一个提示,但没有另外解释就没有解决问题。相反,第一个评论没有神奇:) – yoshi 2012-08-02 08:27:23