我克隆一個全球性項目混帳:似乎無法刪除遠程
git clone https://github.com/lornajane/scripts.git scripts
我添加的遠程分支
git remote add gitlab http://[email protected]/janedoe/my.git
git push gitlab master -f
現在的問題是我沒有http://[email protected]/janedoe/my.git項目了在gitlab上。
所以,當我試圖刪除遠程分支
git push gitlab --delete master
我得到錯誤:
remote: error: By default, deleting the current branch is denied, because the next
remote: 'git clone' won't result in any file checked out, causing confusion.
remote:
remote: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: current branch, with or without a warning message.
remote:
remote: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master
To http://[email protected]/janedoe/my.git
! [remote rejected] master (deletion of the current branch prohibited)
如何消除這種遙控器。謝謝!
可能重複的[如何從git repo中刪除遠程來源](https://stackoverflow.com/questions/16330404/how-to-remove-remote-origin-from-git-repo) – 1615903