Jas*_*n L 3 git git-push git-non-bare-repository
我的设置如下:
我在Mac上运行git版本2.3.2(Apple Git-55)。这有一个非裸露的git仓库,位于~/xyz
。
然后,我在同一台Mac上使用VMWare Fusion运行Windows 7 64bit。VM具有git 1.9.5,这是Windows的最新git版本。从VM中,我可以克隆并从Mac的非裸仓库中拉出~/xyz
OK,但是我不能将其推入。我遵循了这里的建议并继续使用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'.
Run Code Online (Sandbox Code Playgroud)
我也尝试设置,receive.denycurrentbranch=updateInstead
但仍然是相同的错误消息。
每次更改任何git设置后,我都重新启动了计算机。
该目录~/xyz
是我的VM的共享目录,并且我已确保VM具有对其的读/写访问权限。
拜托,有人有什么想法吗?
小智 5
您需要从要推送代码的服务器(而不是本地存储库系统)运行命令
git config --global receive.denyCurrentBranch ignore
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2632 次 |
最近记录: |