During svn to git migration commit authors have wrong email

967 Views Asked by At

I have migrated my svn repo to local git. For some reason all authors look like:

userid <userid@localhost> 

Is there way to change all authors rewriting "localhost" to "myorg.org"

userid <[email protected]> 

UPDATE

userid is not fixed.

1

There are 1 best solutions below

7
On BEST ANSWER

The comments have several suggestions for fixing this during the import process. If you want to fix it after the import is complete, you can use the git filter-branch command to rewrite author emails.

git filter-branch --env-filter '
  GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL/localhost/myorg.org}
  GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL/localhost/myorg.org}
'

This will subsitute myorg.org for localhost in all author and committer emails (on the current branch).