我在服务器上有一个裸露的 git 存储库,其默认分支名为master. 我想把名字改成main.
当我搜索说明时,总是被告知在删除分支之前将defaultGitHub 上的分支更改为新分支。但我的仓库不在 GitHub 上。
当我尝试删除时,我收到此错误消息:mainmastermaster
$ git push origin --delete master
remote: error: By default, deleting the current branch is denied, because the next
remote: error: 'git clone' won't result in any file checked out, causing confusion.
remote: error:
remote: error: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: error: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: error: current branch, with or …Run Code Online (Sandbox Code Playgroud) git ×1