[Part Solved] (was: [Prbl: pushing does not work])

Uwe Brauer oub at mat.ucm.es
Mon Feb 1 14:30:19 UTC 2016


>>> "Uwe" == Uwe Brauer <oub at mat.ucm.es> writes:


   > I obtain an error.
   > ,----
   > | pushing to /home/oub/Git-Hg/Git/
   > | searching for changes
   > | adding objects
   > | Unpacking objects: 100% (3/3), done.
   > | remote: error: refusing to update checked out branch: refs/heads/master
   > | remote:
   > | remote: error: By default, updating the current branch in a non-bare repository
   > | remote:
   > | remote: error: is denied, because it will make the index and work tree inconsistent
   > | remote:
   > | remote: error: with what you pushed, and will require 'git reset --hard' to match
   > | remote:
   > | remote: error: the work tree to HEAD.
   > | remote:
   > | remote: error:
   > | remote:
   > | remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
   > | remote:
   > | remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
   > | remote:
   > | remote: error: its current branch; however, this is not recommended unless you
   > | remote:
   > | remote: error: arranged to update its work tree to match what you pushed in some
   > | remote:
   > | remote: error: other way.
   > | remote:
   > | remote: error:
   > | remote:
   > | remote: error: To squelch this message and still keep the default behaviour, set
   > | remote:
   > | remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
   > | remote:
   > | abort: git remote error: refs/heads/master failed to update
   > | 
   > | 
   > |        
   > `----



It seems that the following setting in the bridg-repo
(.git/config)

Is helpful
,----
| 
| [core]
| 	repositoryformatversion = 0
| 	filemode = true
| 	bare = true
| 	logallrefupdates = true
| [receive]
| 	denyCurrentBranch = ignore
`----

(I am not sure whether to set bare to true or false)

If I understand
https://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked
correctly,


it should be set to true.

This questions turns partially to a git question, however I think it is
still relevant for hg, since it allows to use hg even for a git repo.

Uwe Brauer 



More information about the Mercurial mailing list