1
我有兩個回購在我的本地機器上,說local1
和local2
。所以,我從local1
推入一個非裸回購 - 在我的本地,兩個回購Git
git push local2 sombranch
跑了,我得到這個
remote: error: refusing to update checked out branch: refs/heads/5-0-stable
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
兩個回購幾乎一模一樣的歷史和sllight分歧無法進入衝突。我被迫改變了receive.denyCurrentBranch
?我真的不希望通過這個命令,打開遠程回購的回購裸git config --bool core.bare true
感謝1)我不想那麼做。但是,你能解釋一下爲什麼會發生這種情況:當你拉扯的時候沒有pb?順便說一下,你能否更深入地解釋PLZ 2)(我理解命令而不是底層思想) – Newben