tags:

views:

64

answers:

1

I converted a Subversion repository to Git using git svn but unfortunately only now noticed that some of the author information was wrong. The converted repository is not shared with anybody yet, so I'd like to rewrite the commit logs in it - if possible.

How can I rewrite a git repository so that the log for all his commits show e.g.

Author: John Doe <[email protected]>

instead of

Author: John Do <[email protected]>

I tried to do this myself, and it seems that git-filter-branch is what I need. I didn't manage to make it do this, though.

+6  A: 

The ProGit book has an example of doing this that should probably work for you.

$ git filter-branch --commit-filter '
    if [ "$GIT_AUTHOR_EMAIL" = "schacon@localhost" ];
    then
            GIT_AUTHOR_NAME="Scott Chacon";
            GIT_AUTHOR_EMAIL="[email protected]";
            git commit-tree "$@";
    else
            git commit-tree "$@";
    fi' HEAD
bdukes
Don't forget `GIT_COMMITTER_NAME`.
Ionuț G. Stan