2016-08-02 102 views
0

我想刪除遠程上的'主'分支。注意:我不是想刪除本地主分支,而是遠程上的主分支。如何刪除遠程的主分支?

的命令是

git push origin master --delete 

我收到的錯誤是:

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 my:shared/pop.team/pop.TallyWorld 
! [remote rejected] master (deletion of the current branch prohibited) 
error: failed to push some refs to 'my:shared/pop.team/pop.TallyWorld' 

我目前不是主分支。

此外,我不希望任何默認分支回購。可能嗎?

請提出一個解決方案來刪除遠程主分支。

+0

這是什麼混帳'說status'? – Christoph

+0

由於工作目錄是乾淨的(沒有未分離的更改); git狀態不顯示任何內容。 – vintrojan

回答

1

錯誤消息似乎準確地告訴了該怎麼做。看起來我們不知道的原因,git喜歡呼叫master「當前」分支(雖然在裸露的遠程設備上確實不應該有「當前」概念; HEAD指向遠程默認配置中的master我不知道是否有其他情況)。

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. 

此外,刪除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.