Browse By

Rewrite author and committer email addresses on previous git commits

Lets pretend you had git config --global user.email set incorrectly (or not set at all) and you commits were not recorded on github.com’s contribution activity…

Before you start its probably a good idea to clone your repository somewhere just incase.

To fix this ensure git config –global user.email is set to the primary email address on your Github account. This will change the author and committer email for all commits on the set branch!

  1. “Account Settings -> Emails” under github.com get your primary email address eg; “james@example.com”;
  2. Set your local git configuration to have the correct address: `git config –global user.email “james@example.com”
  3. Run the command below. ***WARNING*** command does a force push so be sure to stash any changes etc before running.

If you need to change only your Committer & Author email address (or names) you can use this handy script from GitHub.

https://help.github.com/articles/changing-author-info 

Leave a Reply

Your email address will not be published. Required fields are marked *