我在本地机器上有两个仓库,比如说local1
和local2
. 所以我从local1
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.
这两个 repo 的历史几乎完全相同,细微的差异不会产生冲突。我是被迫改变的receive.denyCurrentBranch
吗?我真的不想通过这个命令将远程仓库变成裸仓库git config --bool core.bare true