What are the practical consequences of rewriting Git history?

Required reading is Problems with rewriting history in the Git User’s Manual.

If I rewrite history (and everything compiles/works in all affected branches), will my co-workers need to do any special commands (i.e. will they “know that I have done it” if I did it well?)?

They will know, and Git will tell them in no uncertain terms that something is wrong. They will get unexpected error messages, and may in the process of trying to resolve the resulting merge conflicts, inadvertently revert previous commits. This problem creates a real message, and if you’re curious to see what happens you can always try it on a temporary copy of your repositories.

Will any users with local changes that I do not know about be eligible for merge failures on git pull ?

Absolutely, see above.

Am I missing anything essential here ?

Avoid rewriting history at (almost) all costs!

Leave a Comment