What happens to repositories when changing account email address? #185410
Replies: 8 comments 6 replies
-
|
Hi there, This is a really common situation. I’ve seen this before—here is exactly what happens when you switch emails:
No impact. Your repositories are tied to your username, not your email address. Changing your primary email to abc@gmail.com will not change your repository URLs or delete anything. They will stay exactly where they are.
This is where you need to be careful. Git links your past commits to your GitHub profile by matching the email address in the commit log to the emails listed in your account settings. If you remove xyz@gmail.com from your GitHub account entirely, your old commits (which were made with that email) will stop showing your profile picture. They will essentially become "unclaimed" and might not show up on your contribution graph (the green squares). The Fix: You should add abc@gmail.com as your new Primary email, but keep xyz@gmail.com listed as a secondary email on your GitHub account. Do not delete it from GitHub settings even if you stop using the inbox. This ensures your past history stays linked to you.
If you delete the Gmail account: Nothing happens to your GitHub repos. GitHub doesn't check if the inbox still exists; it just uses the email string as an ID. If you delete your GitHub account: Then yes, all your repositories will be deleted. Summary: Add abc and make it Primary. Keep xyz on the list so you don't lose your "green squares" history. Your repos are safe as long as you don't delete the GitHub account itself. Hope this helps you make the switch safely! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
If you only want to switch email, your repos are safe. I'm already done this once, hope this helps 🙏. |
Beta Was this translation helpful? Give feedback.
-
|
Hey there! 👋 Thanks for posting in the GitHub Community, @dev4Kushal ! We're happy you're here. You are more likely to get a useful response if you are posting in the applicable category. The Accessibility category is a place for our community to discuss and provide feedback on the digital accessibility of GitHub products. Digital accessibility means that GitHub tools, and technologies, are designed and developed so that people with disabilities can use them. I've gone ahead and moved this to the correct category for you, |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Repositories are tied to your GitHub account, not your email. Changing your primary email from xyz@gmail.com to abc@gmail.com has no impact on repository ownership or URLs. They remain fully intact. Commits are tied to emails in the commit metadata. Commits made with xyz@gmail.com will still be associated with that email. If you remove xyz@gmail.com from your GitHub account, those commits will no longer link to your profile, and your contribution graph won’t show them. To prevent this, keep xyz@gmail.com listed as a secondary email even after switching primary to abc@gmail.com. Deleting the Gmail account xyz@gmail.com itself does not delete anything on GitHub. GitHub only cares about the email string as it relates to commit attribution, not whether the email inbox still exists. Deleting your GitHub account deletes your repositories. Changing emails does not affect this. If you delete your GitHub account, all your repos go with it, regardless of which email is primary. ✅ Safe approach: Add abc@gmail.com as your primary email. Keep xyz@gmail.com as a secondary email for commit history. Don’t delete your GitHub account. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @dev4Kushal , hope you get it ! Here is a breakdown of what will happen: b. Impact on Repositories c. If the Gmail Account (xyz@gmail.com) is Deleted |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
GitHub Feature Area
Other
Body
Hi everyone,
I have a GitHub account with the email xyz@gmail.com and I've created several repositories with it. Now I want to change my account's primary email to abc@gmail.com.
I have a few questions about what will happen:
My existing repositories under which email account and creation name of repos will be on which name?
What will be the impact on repositories?
What if xyz@gmail.com is account deleted will the repos also deleted or no impact will be there?
I want to make sure I understand the implications before making this change. Any guidance would be greatly appreciated!
Thanks in advance! 🙏
Beta Was this translation helpful? Give feedback.
All reactions