What happens to repositories when changing account email address? #185410
Replies: 3 comments 1 reply
-
|
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.
-
|
Changing your GitHub account’s primary email address does not affect your repositories. Key points -- Repositories are associated with your GitHub account (username/user ID), not with an email address. Changing your primary email will not change: Repository ownership Repository names or URLs Commit history Stars, forks, issues, PRs, or collaborators Email changes only affect: Where GitHub sends notifications Which email is used for new commits, depending on your local Git configuration If the old email (xyz@gmail.com) is deleted later: There is no impact on repositories Repos are deleted only if the GitHub account itself is deleted, not when an email address is removed Summary: |
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.
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