How to Change Author Name and Email of Commits? #22185
-
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? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 2 replies
-
Great question, thanks for asking! These are all pretty common questions that we have help pages for:
I hope that helps 😀 |
Beta Was this translation helpful? Give feedback.
-
Just the information i was looking for. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@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! |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I applied for an account with the username BobMarq and then accidentally entered a mispelled e-mail address |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
This is the most recent version I can find working
Changing author info - GitHub Docs |
Beta Was this translation helpful? Give feedback.
-
This did not work for me. After I executed the script I got the following:
Then I executed: And got the following message: When I reloaded the repository on Github, no changes took effect. Anyone could suggest what has to be done? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Apparently, in my case email address was used as either Extending and
made it work. |
Beta Was this translation helpful? Give feedback.
-
I was not aware of this and recently cleaned up my account information (as you do with many accounts when your email addresses change) and just realized that I thus lost 5 years worth of work associated with those old addresses. Maybe a straightforward solution to this whole issue would be to add an option in the settings for users to choose whether to list contributions by email address or account. It doesn’t seem likely to me that the majority of users wish to disassociate themselves from previous work, so association-by-account seems the more reasonable default. In contrast kicking past contributions off your account should be an active choice and not something that simply happens as a by-product of basic account maintenance. |
Beta Was this translation helpful? Give feedback.
Great question, thanks for asking!
These are all pretty common questions that we have help pages for:
I hope that helps 😀