我試圖刪除遠程主分支:無法刪除遠程主分支
git push origin :master
我分支的清單:
$ git branch -avv
* survey-content c3356d9 [origin/survey-content] Runtime textures for survey
remotes/origin/master 4300c27 New Survey layout for message header
remotes/origin/survey-content c3356d9 Runtime textures for survey
當我做git push
我前面提到的,我出現以下錯誤:
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/master
To c:/Dropbox/Repositories/repo.git
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to 'c:/Dropbox/Repositories/repo.git'
這是我推到一個純倉庫,所以應該沒有「真正水流nt分支「。爲什麼我無法遠程刪除主分支?它應該與任何其他分支沒有區別,特別是因爲我以前已經擺脫了origin/HEAD
。
恕我直言,裸庫中,應當默認啓用該變量,它的比沒有設置的幫助更煩人。感謝您的解釋,但對於像我這樣的新手來說,這似乎很不直觀,因爲它表現得如此奇怪。 –
git中有很多奇怪的東西...... :-) – torek