Fixing Email Addresses in Git Repos after migration from Mercurial using Fast Export
30 Mar 2013Migrating repos from Mercurial to Git can be achieved by a variety of methods. The best method I've found is to use fast-export (not HgGit), however regardless of the method they all borked the importing of my email address on commits. In this post I'll detail how to fix this.
First I performed the conversion as detailed here.
After this all my commits where shown in gitk as devnull@localhost
although this only came to my attention when I tried to push to github and got an invalid-email-address error
.
This can be easily fixed using the git filter-branch
command:
Obviously the placeholders need to be replaced with your values.
This code is based on a stackoverflow answer but that only works for the current branch, mine applies to all branches.