Change Git Author/Committer Name and eMail in the History

This happens to me all the time: I have a default user.name and user.email set in the global git config, but when I work on a project I sometimes must use another name. Usually I change it before my first commit, but that’s more the exception than the case. And just now I realized that I can change the commiter name/email in a working repository for all my previous commits. Awesome!! And it’s a one-liner:

git filter-branch --env-filter 'GIT_AUTHOR_NAME="pubmem";GIT_AUTHOR_EMAIL="pubmem@something.net";GIT_COMMITTER_NAME="pubmem";GIT_COMMITTER_EMAIL="pubmem@something.net";' HEAD

UPDATE:

Don’t do this when working with git-svn!😉

References

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: