当我收到错误时如何移除远程分支? [英] how do I remove a remote branch when I get an error?

查看:85
本文介绍了当我收到错误时如何移除远程分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  git push origin:next 
remote:error:拒绝refs / heads / next的ref删除
转到blah.git
! [远程拒绝]下一个(删除禁止)
错误:未能将一些文件推送到'blah.git

我使用的是gitolite,在钩子中找不到任何此错误消息。我怎样才能禁用这个,这样我可以删除或重命名这个远程分支?当我运行git branch -r -d origin / next时,它似乎消失了,但是下一个git pull将它带回了右边。 解决方案

确保在你的gitolite配置中,你有倒带标志,而不是 RW 使用 RW + 。这将允许你删除分支和提交。



git push -f origin:next


I have tried the following command and it fails.

git push origin :next
remote: error: denying ref deletion for refs/heads/next
To blah.git
 ! [remote rejected] next (deletion prohibited)
error: failed to push some refs to 'blah.git

I am using gitolite and cannot find any of this error message in the hooks. How can I disable this so that I can delete or rename this remote branch? When I run git branch -r -d origin/next, it appears to go away, but the next git pull brings it right back.

解决方案

Make sure in your gitolite config, you have the rewind flag on so instead of RW use RW+. That will allow you to delete branches and commits.

git push -f origin :next

这篇关于当我收到错误时如何移除远程分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆