Tag Archives: git

Git Push – Remote Rejected solution

You made a git repo on workstation 1, committed your changes, then from workstation 2 made a git init/pull. More changes, more commit… and its time to push all that mess back to workstation 1 ( the original )

$git push workstation1.tld

Counting objects: 32, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (24/24), 13.63 KiB, done.
Total 24 (delta 6), reused 0 (delta 0)
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'.
To rocket.x.TLD.com:~/code/pydbgp
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'rocket.x.lijit.com:~/code/pydbgp'

What the hell?

Stack overflow to the rescue with this Answer at stackoverflow

So basically… on workstation 1 do

Workstation1$git branch BeforeThePushBranch
Workstation1$git checkout BeforeThePushBranch
Workstation2$git push workstation1
Workstation1$git checkout master

Bam, back working again

Bridging the gap: GIT & SVN, B.F.F.


I’ve been using SVN for several years now, since late 2005 or early 2006, and its done me well since then. But a new darling has entered my life and its name is Git. I like git for some very specific reasons: It’s stupid easy to work with and as good or better then SVN for reliability. Also it helps that my preferred IDE, Komodo, recognizes and works with Git as well.
That said, I use google code for hosting my public projects and it only supports SVN and HG. So one night I read up on git and noticed that it had a plugin/support for bridging to a SVN managed repo. So began my journey.
Continue reading