Git: change the author and committer of history commit

Posted: November 5, 2015 in Knowledge Base
Tags:
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "john" ]; then export GIT_AUTHOR_NAME="John Smith"; export GIT_AUTHOR_EMAIL=john@gmail.com; export GIT_COMMITTER_NAME="John Smith"; export GIT_COMMITTER_EMAIL=john@gmail.com; fi; git commit-tree "$@"'

The above script will change the author and committer name for those commits whose author name is john

Advertisements

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