I wanted to manage one of my projects modules as a submodule, instead of
continuously maintaining the submodule in the project, as well as in its
designated remote repository. So I deleted the current module in my
project and added it as a submodule from its remote repository. I did a
few commits. No problems so far. But now I want to push those commits to
the remote repository from within my project. Now the surprise: It does
refusing to update checked out branch: refs/heads/master
By default, updating the current branch in a non-bare repository
is denied, because it will make the index and work tree inconsistent
with what you pushed, and will require 'git reset --hard' to match
the work tree to HEAD.
You can set 'receive.denyCurrentBranch' configuration variable to
'ignore' or 'warn' in the remote repository to allow pushing into
its current branch; however, this is not recommended unless you
arranged to update its work tree to match what you pushed in some
To squelch this message and still keep the default behaviour, set
'receive.denyCurrentBranch' configuration variable to 'refuse'.
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/home/joe/CloudFusion'
Unable to imagine why pushing my commits should pose any problem what so
ever, I tried:
$git config receive.denyCurrentBranch ignore
Still no success. I guess I need to set this somewhere else. Perhaps at
my remote repository on Github? - I wouldn't know how to do this.
Another thing I guess would work is to make a local clone of my project,
but why do I even need to go through all this trouble? Most importantly,
how can I push my commits in the most simple way?
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at