tl;dr:
Install git filter-repo
Clone the repository you want to fix up
To change commit author metadata: create a file mailmap.txt
, with
contents like this:
Your Name <name@example.net> Dead Name <dead@example.net>
To change file contents (e.g. copyright notices): create a file
replacements.txt
, with contents like this:
Dead Name==>Your Name
dead@example.net==>name@example.net
Run this command:
git filter-repo --mailmap mailmap.txt --replace-text replacements.txt
--mailmap
or --replace-text
argument respectively, along with the following filename--force
for this to work (but be sure that you have
a backup of your repository in this case!)This won't alter the commit timestamps (unlike a rebase), but it will still change the hashes, which will cause many problems if you run this on a repository that other people use.