【发布时间】:2015-10-11 17:19:03
【问题描述】:
我的设置如下:
我在我的 Mac 上运行 git 版本 2.3.2 (Apple Git-55)。这有一个位于 ~/xyz 的非裸 git 存储库。
然后我在同一台 Mac 上使用 VMWare Fusion 运行 Windows 7 64 位。 VM 有 git 1.9.5,这是适用于 Windows 的最新 git 版本。我可以从 VM 克隆并从我的 mac 的非裸仓库~/xyz 中提取,但我无法推送到它。我遵循了here 的建议并在~/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 目录是我的 VM 的共享目录,我已确保 VM 对其具有读/写权限。
请问,有人有什么想法吗?
【问题讨论】:
标签: git git-push git-non-bare-repository