git 如何从bitbucket中删除git远程分支?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8045675/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove the git remote branch from bitbucket?
提问by qrtt1
I try to remove the git remote branch on the bitbucket by git push command:
我尝试通过 git push 命令删除 bitbucket 上的 git remote 分支:
qty:workspace qrtt1$ git push origin :my_branch
remote: fatal: bad object 0000000000000000000000000000000000000000
remote: bb/acl: qrtt1 is allowed. accepted payload.
remote: fatal: bad object 0000000000000000000000000000000000000000
To [email protected]:qrtt1/workspace.git
- [deleted] my_branch
However, only the branch in my local stroage removed. How do I remove it ?
但是,只有我本地存储中的分支被移除了。我如何删除它?
PS. I can remove the remote branch in the same way from github.
附注。我可以用同样的方式从 github 中删除远程分支。
采纳答案by manojlds
Eventhough, it says those errors / warnings (probably some post hook that BitBucket has that is not proper?), it has gone ahead and deleted the my_branch
branch, as indicated by the last line. Go to the web UI and confirm that the branch is indeed gone.
尽管,它说的是那些错误/警告(可能是 BitBucket 的一些不正确的 post 钩子?),它已经继续并删除了my_branch
分支,如最后一行所示。转到 Web UI 并确认分支确实消失了。
回答by smbruce
You can't delete a branch from Bitbucket if that branch is set as the Main Branch. You need to go into the Adminsection of your Bitbucket repository and select a different branch for the Main Branch. You should then be able to remote the branch using
如果该分支设置为Main Branch,则无法从 Bitbucket 中删除该分支。您需要进入Bitbucket 存储库的Admin部分并为Main Branch选择一个不同的分支。然后,您应该能够使用远程分支
git push <repository> :<branch>
回答by haxpor
I found the same problem, only the local is removed but not remote. Finally I found the solution from http://groups.google.com/group/gitorious/browse_thread/thread/5afe8581cdd96d2b, just use
我发现了同样的问题,只删除了本地而不是远程。最后我从http://groups.google.com/group/gitorious/browse_thread/thread/5afe8581cdd96d2b找到了解决方案,只需使用
git push <repository> :<branch>
After that checked on bitbucket website, it should be gone.
在bitbucket网站上检查之后,它应该消失了。