报错:
git -c diff.mnemonicprefix=false -c core.quotepath=false branch -d -r origin/new_master Deleted remote branch origin/new_master (was 6625aae). git -c diff.mnemonicprefix=false -c core.quotepath=false push origin :new_master remote: error: refusing to delete the current branch: refs/heads/new_master To https://Xiaodong_Gong@bitbucket.org/Xiaodong_Gong/my_bit.git ! [remote rejected] new_master (deletion of the current branch prohibited) error: failed to push some refs to 'https://Xiaodong_Gong@bitbucket.org/Xiaodong_Gong/my_bit.git' Completed with errors, see above [remote rejected] master (deletion of the current branch prohibited)
原因:
这可是主分支,岂是你想删,想删就能删的?
解决:
通过更改主分支,都不是主分支了,就可以删掉了。
我用的是bitbucket。打开你的项目,看左侧有个Settings,点进去,把主分支改成别的分支就可以了。
至于别的代码托管网站,自己登上去找找就是了。
另:调整主分支/删除分支之类的动作,最好先搞个demo试试,练练手,以免造成难以恢复的损失。