如何从 GitHub/Bitbucket 删除远程 master 分支?
我正在尝试:
# git push bb --delete master
remote: bb/acl: user is allowed. accepted payload.[K
remote: error: refusing to delete the current branch: refs/heads/master[K
To ssh://git@bitbucket.org/user/reponame.git
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to 'ssh://git@bitbucket.org/user/reponame.git'
我也试过了
git push bb :master
但这一切都不起作用。
最佳答案
注意:对于 Bitbucket,您可以通过访问存储库的设置来更改默认分支,并在“Main branch
”组合框。
一旦主分支不再是master,那么you can push and remove master .
MarsAndBack在 the comments 中确认这也适用于 GitHub。
关于git - 删除远程主分支,由于是当前分支而被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14040754/