Careful now, git push -f requires that everyone on the team have as good an understanding of git as you do, particularly when dealing with shared branches like master.
We generally don't ever want to see rewriting history on shared branches, because once any other team member grabs the latest (fetch/pull), they're going to have to deal with branches that have diverged. It goes from being a problem for one dev, to being a problem for the whole team.
When others are involved, it's a much better practice to resolve the issue as a fast-forward or merge commit, then tack that on to the HEAD of the remote branch.
Careful now,
git push -frequires that everyone on the team have as good an understanding ofgitas you do, particularly when dealing with shared branches likemaster.We generally don't ever want to see rewriting history on shared branches, because once any other team member grabs the latest (
fetch/pull), they're going to have to deal with branches that have diverged. It goes from being a problem for one dev, to being a problem for the whole team.When others are involved, it's a much better practice to resolve the issue as a fast-forward or merge commit, then tack that on to the
HEADof the remote branch.Agreed, I will probably add that as a warning. Good suggestion.