Dear all,

I need some help to get some git repository back to functioning properly.

I am developing some project completely on my own, and I have a local and a 
remove repository/branch (the latter at GitHub). I started development two 
years ago, then the project paused for a while, and now I wanted to push a 
few more commits. I was surprised to get the following error message.

$ git push
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to ''
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

No-one except me ever pushed anything to the remove branch, so I had no 
idea where this came from. I tried to do what the error message said. 
Everything was up-to-date as expected. 

$ git pull
Already up-to-date.

I again tried to push, but still got the same error message as above. So, I 
searched for possible solutions in the git documentation and online, and 
then I did what some recommended, because I knew as the only developer I 
could not overwrite the work of anyone else. Before doing this, my local 
branch was 17 commits ahead of the remote branch.

$ git push --force
Total 0 (delta 0), reused 0 (delta 0)
 + d28162f...e083c14 master -> master (forced update)

Unfortunately, this did not work out as planned, instead of pushing the new 
17 commits to the remote branch, the remote branch went back to an older 
version now 34 commits behind my local branch.

$ git status
On branch origin-master
Your branch is ahead of 'origin/master' by 34 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

Now, before accidentally actually ruining anything I decided to better ask 
this mailing list. What do you suggest in this situation. 

Thanks a lot! 

Torsten Anders

PS: I am using git version 2.0.1 on OS X (10.9.5). I may add that in 
addition to invoking git directly at the command line I commonly use the 
Emacs package magit. I assume I updated that package during the two years 
before the new push trial, and I tried pushing with magit first. Not sure 
whether that could have caused some problem.  

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to