无法删除github上的main分支?

我的github仓库,有master,main两个分支,我想删除远程的main分支

git push origin --delete main
报错

To https://github.com/accountname/repo.git
 ! [remote rejected] main (refusing to delete the current branch: refs/heads/main)
error: failed to push some refs to 'https://github.com/accountname/repo.git'

请问,如何解决?

阅读 622
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进