当前位置:   article > 正文

Git 移除远程指定分支提示: [remote rejected] main (refusing to delete the current branch: refs/heads/main)_! [remote rejected] main (refusing to delete the c

! [remote rejected] main (refusing to delete the current branch: refs/heads/

今天在执行Git 删除远程指定分支,提示如下截图错误信息:

  1. zzg@LAPTOP-8R0KHL88 MINGW64 /e/idea_workspace/smart-medical (master)
  2. $ git push origin :main
  3. To github.com:zhouzhiwengang/SpringCloud-.git
  4. ! [remote rejected] main (refusing to delete the current branch: refs/heads/main)
  5. error: failed to push some refs to 'github.com:zhouzhiwengang/SpringCloud-.git'

错误原因:删除指定的分支是当前默认分支,所以无法删除。

解决办法:将当前默认分支有main 修改master.

 修完完毕之后,不要忘记点击旁边的 update 按钮,update一下才能生效。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/412279
推荐阅读
相关标签
  

闽ICP备14008679号