Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Change email address associated with existing commit

Grahame Grieve December 21, 2014

I have rights to push to a GitHub repository. The rights are associated with one of my email addresses. I committed in sourcetree, and then tried to push to the github repository. It failed, because SourceTree was using the wrong email address (one of my other ones). 

I have reconfigured Sourcetree to use the right email address in the repository settings, but it's ignoring that when I try to push the commit I've already made - and I can't figure out how to resolve this. reversing the commit says it's just going to create a new one, which leaves me in the same place. 

How can I resolve this?

2 answers

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 2, 2015

The easiest way is this:

  1. [Make sure you have no uncommitted changes and perhaps make a backup of the folder with the clone.]
  2. Do a soft reset to the point right before the (first) commit with the wrong e-mail address.
  3. Create the commit(s) again with the same changes.
  4. Push the stuff again.
0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2014

You probably need to use the git command line to modify the commit metadata. I don't know how, but you may have more luck searching for an answer on StackExchange.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events