我的设置如下:
我在我的 Mac 上运行 git 版本 2.3.2 (Apple Git-55)。这有一个非裸 git 存储库位于~/xyz
.
然后我在同一台 Mac 上使用 VMWare Fusion 运行 Windows 7 64 位。VM 有 git 1.9.5,这是适用于 Windows 的最新 git 版本。从VM我可以克隆并从我的mac的非裸仓库中提取~/xyz
,但我无法推送到它。我已按照此处的建议进行设置receive.denycurrentbranch=ignore
,~/xyz
但仍然给我相同的错误消息:
remote: error: refusing to update checked out branch: refs/heads/master
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.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
我也尝试过设置receive.denycurrentbranch=updateInstead
但仍然是相同的错误消息。
每次更改任何 git 设置后,我都重新启动了计算机。
该目录~/xyz
是我的 VM 的共享目录,并且我已确保 VM 具有对其的读/写访问权限。
请问,有人有什么想法吗?