How to Change Author Name and Email of Commits?

How can i change the author name and email settings globally for future commits? Is there also a way to just do this per repository? Can i also change this information on past commits?  

3 Likes

Great question, thanks for asking!

These are all pretty common questions that we have help pages for:

I hope that helps :grinning:

11 Likes

Just the information i was looking for. Thanks!

3 Likes

@lee-dohm wrote:

Great question, thanks for asking!

 

These are all pretty common questions that we have help pages for:

 

 

I hope that helps :grinning:

@teazateazza It looks like you were maybe trying to respond here, but only the quote of @lee-dohm’s comment came through. You might want to edit your post to make sure your whole message is shared. Thanks!

Related question: What happens when we lose access to an email address (for example, when changing employers) that our previous commits were associated with. It looks like all the commit and contribution history is lost. Years worth of history. This is super inconvenient.

The second option you listed below doesn’t work since most authors don’t own the repos, and even if they did, rewriting git history is not a good practice.

GitHub knows that all these commits were made by the author, even if that author does not get to keep his/her email address forever. So ideally GitHub should be able to still associate those commits to the correct author.

Is there anyway to recover history? Thanks for your help.

2 Likes

You don’t have to remove an email address from the list of email addresses in your GitHub account simply because you’ve lost access to it. You can leave it associated to your account to maintain a connection with your old history. You should make certain that you always have access to at least one email address associated with your GitHub account for password resets, email notifications and the like. But you don’t have to remove an email address just because it isn’t current.

The way the system currently works, associating commits by email address, is the best balance between multiple needs. There are also times that people want to divorce themselves from work they did in the past and removing the email address from the list of addresses that apply is an easy way to do that. If we used some other way of tracking contributions, removing unwanted items from your history would be a much more complex affair.

2 Likes

I applied for an account with the username BobMarq and then accidentally entered a mispelled e-mail address

The second link isn’t working for me.

Has it been removed on purpose?

If not, could you please update the link or post a new working one?

This is the most recent version I can find working