John Livermore
John Livermore

Reputation: 31313

GitHub command to force a checkin

I have code on my client that conflicts with a checked in version. Is there a way to tell Git to "ignore the origin version and force my version over it"?

Upvotes: 1

Views: 99

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 993085

Yes, you can do this using the git push -f command. The -f command is the "force" option, which pushes your current ref to the upstream, even if your current history is not derived from the upstream.

You can easily lose work with this command. Be careful.

Upvotes: 1

Related Questions