我有一个本地存储库,想要将其镜像到远程的“websrv”。这曾经可以正常工作,但是在我删除了一个本地分支后,现在执行此操作时会出错:
git push --mirror websrv
我明白了
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 without a warning message.
remote: error:
remote: error: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/ecoli-moments
To git@141.89.117.199:~/baki_tracking.git
! [remote rejected] ecoli-moments (deletion of the current branch prohibited)
分支'ecoli-moments'指向与主分支相同的提交,本地和远程都是如此。
我该怎么做才能正确删除远程分支?
更新:
远程仓库是裸仓库,我在服务器上检查了目录(配置文件为bare=true)。