Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Moderator
Message 1 of 7

How to Change Author Name and Email of Commits?

Solved! Go to Solution.

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?  

6 Replies
Solution
Community Manager
Message 2 of 7

Re: How to Change Author Name and Email of Commits?

Great question, thanks for asking!

 

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

 

 

I hope that helps 😀

Moderator
Message 3 of 7

Re: How to Change Author Name and Email of Commits?

Just the information i was looking for. Thanks!

Copilot Lvl 2
Message 4 of 7

Re: How to Change Author Name and Email of Commits?


@lee-dohm wrote:

Great question, thanks for asking!

 

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

 

 

I hope that helps 😀


 

Moderator
Message 5 of 7

Re: How to Change Author Name and Email of Commits?

@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!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Ground Controller Lvl 1
Message 6 of 7

Re: How to Change Author Name and Email of Commits?

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.

Community Manager
Message 7 of 7

Re: How to Change Author Name and Email of Commits?

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.