Git 移除远程指定分支提示: [remote rejected] main (refusing to delete the current branch: refs/heads/main)
Posted 在奋斗的大道
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Git 移除远程指定分支提示: [remote rejected] main (refusing to delete the current branch: refs/heads/main)相关的知识,希望对你有一定的参考价值。
今天在执行Git 删除远程指定分支,提示如下截图错误信息:
zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace/smart-medical (master)
$ git push origin :main
To github.com:zhouzhiwengang/SpringCloud-.git
! [remote rejected] main (refusing to delete the current branch: refs/heads/main)
error: failed to push some refs to 'github.com:zhouzhiwengang/SpringCloud-.git'
错误原因:删除指定的分支是当前默认分支,所以无法删除。
解决办法:将当前默认分支有main 修改master.
修完完毕之后,不要忘记点击旁边的 update 按钮,update一下才能生效。
以上是关于Git 移除远程指定分支提示: [remote rejected] main (refusing to delete the current branch: refs/heads/main)的主要内容,如果未能解决你的问题,请参考以下文章