我的设置如下:
我在Mac上运行git版本2.3.2(Apple Git-55),有一个非裸的git存储库位于~/xyz
。
然后,我在同一台Mac上使用VMWare Fusion运行Windows 7 64位。该虚拟机具有最新的Windows git版本1.9.5。从虚拟机中,我可以克隆和拉取来自Mac的非裸repo ~/xyz
,但无法向其推送。我已按照这里的建议,在~/xyz
上设置了receive.denycurrentbranch=ignore
,但仍然给出相同的错误消息:
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
是我的虚拟机共享目录,并且我已确保虚拟机具有对其的读/写访问权限。
请问,有人有什么想法吗?