Search code examples
gitgit-svnsubgit

During svn to git migration commit authors have wrong email


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 <userid@myorg.org> 

UPDATE

userid is not fixed.


Solution

  • 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).