Changing author name for all git logs

I recently realized I had goofed up with setting up my GIT account with an incorrect name. I found this cool way to update the logs and update the username to the correct one:

Note: This would update all commits so far. If you wanted to modify commits for specific user, then you may have to write a bash script for it. You can find more details here: http://stackoverflow.com/questions/750172/change-the-author-of-a-commit-in-git. But the below would work fine if it’s only yourself in the previous logs.
Just execute this command within your GIT home repository:

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='varun.verma'; GIT_AUTHOR_EMAIL='varun.verma@accellion.com'; GIT_COMMITTER_NAME='varun.verma'; GIT_COMMITTER_EMAIL='varun.verma@accellion.com';" HEAD 
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