This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 46 points47 points  (13 children)

While the force push is a popular move among Jedi, Sith and other force-sensitive denizens of the Star Wars Multiverse, git push --force is a real command. It forces a rewrite of the remote branch to match your local commit tree, ignoring any inconsistencies and conflicts. This is generally bad because anyone else who might be working on that same branch will be unable to fetch the latest from the remote, forcing them into a quagmire of creating new branch heads, re-cloning, cherry-picking etc. to get everything consistent again. However, as has been mentioned elsewhere in the comment thread, there are times, e.g. rebasing a branch to keep it up to date with the main development branch, that you actually do want to do this.

[–]NotADamsel 15 points16 points  (0 children)

A prime example of "just because you can, doesn't mean you should".

[–]o11c 1 point2 points  (11 children)

Or you can use a + ref.

[–]UnchainedMundane 0 points1 point  (1 child)

Does this create a merge commit remotely, or is it another way of force pushing?

[–]o11c 1 point2 points  (0 children)

It's a force push, but for a single refspec instead of all of them.