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.

3
  • $git push --force origin master Commented Oct 3, 2017 at 17:21
  • 2
    This worked for me: personal project with 0 other collaborators. I had tried several other suggested "solutions" here on SO, none of which fixed what was a very simple problem: I had done a local reset --hard to a older commit and then done a couple more. Then I just wanted to push but the remote repo was not prepared to let me. WarrenP could actually help git learners by being less runic. Maybe he doesn't want to. Commented Nov 19, 2017 at 15:28
  • 3
    Either don't use it, or learn to use it right. If you force push to an important central repository shared by a team, you should lose all push access to all important repos. What you do on your own personal repo, to avoid learning the alternative ways out, will eventually affect your ability to work on shared repos. If you know what's happened before the force push, sometimes a force push is ok. If you don't, it's never ok.
    – Warren P
    Commented Dec 4, 2017 at 16:39