我想從中央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