How to remove the git remote branch from bitbucket?

£可爱£侵袭症+ 提交于 2019-12-03 08:27:44

问题


I try to remove the git remote branch on the bitbucket by git push command:

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 git@bitbucket.org: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.


回答1:


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.




回答2:


You can't delete a branch from Bitbucket if that branch is set as the Main Branch. You need to go into the Admin section of your Bitbucket repository and select a different branch for the Main Branch. You should then be able to remote the branch using

git push <repository> :<branch>



回答3:


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

git push <repository> :<branch>

After that checked on bitbucket website, it should be gone.



来源:https://stackoverflow.com/questions/8045675/how-to-remove-the-git-remote-branch-from-bitbucket

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!