Reputation: 4140
We have a dev team of 10 and our 7,000 commit history needs a little bit of maintenance. People have committed with the wrong credentials (making our author list rather gross), and I'd also like to obliterate a grunt dist/ directory that we don't need to track in git any longer (truth be told, we never should have been tracking dist/, but that's another subject...)
My question is, what is the best way to push the history changes to origin without causing any issues for the team? After my rewrites (locally), I'm showing 3 times as many commits as we had originally. I will make sure the timing of this push is such that everyone needs to branch from master, but I'm not sure what sort of negative affects could come from this action.
Is there a way that I can clean up the history after making these changes, or what's the best way to go about this?
Upvotes: 0
Views: 288
Reputation: 116167
You should not rewrite history as it is very intrusive - everybody will have to re-clone repository from scratch.
Instead, consider creating appropriate .mailmap
file as described in git shortlog documentation. .mailmap
allows to display weird-looking authors in consistent way, thus solving your problem without touching history.
If you really have to rewrite, you can use this recipe, but it only works for linear history (one branch without any merges).
Upvotes: 2