Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 19
    The other answers did not solve the problem I was having (for instance, I had already committed and still had this error), but doing a git push origin BRANCH --force worked. Thank you! Commented Mar 5, 2013 at 1:35
  • See this earlier answer. I suspect that you needed to add a file because git won't track empty directories. Commented Apr 4, 2014 at 20:57
  • 4
    push --force could also completely blew away co-workers hard work. Added warning by it. Commented Jun 8, 2015 at 0:15
  • 4
    This solved my problem. I think git add did it. While pushing things at first git doesn't recognize things, may be that's why I had the problem. git add command solved my problem. also after that i was able to push without --force. Thanks Aryo Commented Oct 4, 2015 at 13:36