Has anyone got a script for git that can go through the history, check out each version, apply a cleanup script, then check the cleaned version into another repository?
I have some code which I’ve been developing, but I haven’t been consistent with code formatting e.g. tabs vs spaces etc. I’d like to rewrite my entire history to be consistent with the new standards.
The
git filter-branchcommand does what you need.For example:
But be careful… this transforms the git repository.
If somebody has a clone… it will not be connected to your new repo anymore.
From
man git filter-branch: