My setup is as follows:
I am running git version 2.3.2 (Apple Git-55) on my mac. This has a non-bare git repository sitting at ~/xyz
.
Then I am running Windows 7 64bit using VMWare Fusion on the same mac. The VM has git 1.9.5, which is the latest git version for Windows. From the VM I can clone and pull from my mac's non-bare repo ~/xyz
OK, but I cannot push to it. I have followed the suggestion here and set receive.denycurrentbranch=ignore
on ~/xyz
but still gives me the same error message:
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'.
I have also tried setting receive.denycurrentbranch=updateInstead
but still the same error message.
I have restarted the computer after each instance of changing any git settings.
The directory ~/xyz
is a shared directory to my VM, and I have ensured the VM has read/write access to it.
Please, anyone has any ideas?
You need to run the command from the server where you are pushing the code not from the local repo system