Reputation: 63580
The remote repository contains a bad version. I have the copy of a good version locally. I want to replace everything that's on the remote repository with my current repository (the remote repository has a few more commits (including a merge) that should not have happened).
If I try to push, it tells me I need to pull first, but I don't want to do that, because that would mess my local version. I want the remote repo to contain what I have locally.
How can I do that?
Upvotes: 25
Views: 23610
Reputation: 6798
I usually use a process like this to preserve exactly what changed, have an isolated branch that's a known good copy, etc. It's probably excessive compared to using --force, but I prefer it.
Upvotes: 3
Reputation: 527378
Use the --force
, Luke.
http://www.kernel.org/pub/software/scm/git/docs/git-push.html
Upvotes: 72