contributions disappeared after deleting email but re-added it #167232
Replies: 4 comments
-
|
When you remove your primary email address from your GitHub account, any contributions (commits, PRs, etc.) that were made with that email may temporarily disappear from your contributions graph and history. If you re-add and verify the same email address, those contributions should typically reappear, as long as the email in your commit history matches exactly with the verified email on your account. If your contributions have not been restored after re-adding and verifying your email:
If everything checks out but the problem persists, refer to the official documentation:
If you still can't recover your contribution history, you may need to contact GitHub Support directly for further investigation. |
Beta Was this translation helpful? Give feedback.
-
|
When you remove and then re-add your primary email, GitHub may temporarily lose track of your past contributions because it ties commits to verified emails.
Usually, contributions return automatically once GitHub reprocesses the verified email association. |
Beta Was this translation helpful? Give feedback.
-
|
@Willium1925 I think u should wait for some hours then try or u can check by GitHub desktop if in your GitHub desktop repo are showing that good they will also come but if in ur desktop they are not then that will be problem. then us should contact to GitHub. |
Beta Was this translation helpful? Give feedback.
-
Fix: Commits not showing on contribution graph after re-adding your email (solely for solo private repo).I retrieved my contributions with my files intact.
Why it happensEvery Git commit has a unique hash (a commit ID). That hash is generated from the commit’s contents and metadata such as the author email, timestamps and commit message. If any of that changes, the commit gets a completely new hash. GitHub links commits to your contribution graph using the email address stored in the commit metadata. If commits were made with an email that is no longer associated with your account, or an email that was temporarily removed/unverified, GitHub may stop attributing those commits to you. The commits still exist normally in the repository, but GitHub no longer associates them with your profile contributions. What we'll doWe’ll rewrite the commits so they contain your currently verified GitHub email address. That creates brand-new commit hashes. When GitHub scans the rewritten commits, it sees your verified email attached to them and can associate them with your contribution graph again. We’ll also preserve the original commit dates so the contributions stay on the correct calendar days. Before you startPlease make sure:
We’ll do everything from the Terminal of your computer. Step 1: Back up the repoStand in the folder that contains your repo, then make a copy: cd ~/Desktop # the folder your repo lives in
cp -r my-repo my-repo-backup # make a full backup copy
cd my-repo # go into the repo to workReplace cd ~/Desktop
cp -r health-stats health-stats-backup
cd health-statsIf anything goes wrong later, you can delete the broken folder and copy the backup back. Step 2: Make sure you have no uncommitted changesThe rewrite won't run if you have edits you haven't committed yet. Check: git status
Keep them (set aside safely, bring back later): git stashThrow them away (you don't want them): git checkout -- .Now we run Step 3: Rewrite every commit (the core step)This gives each commit a new hash, stamps your correct email, and keeps the original dates (so the squares land on the right days). git rebase --root --exec 'GIT_COMMITTER_DATE="$(git show -s --format=%aI HEAD)" git commit --amend --no-edit --author="Your Name <your-verified-email@example.com>"'
If it finishes with Step 4: Only if Step 3 stopped with an error about "untracked working tree files"The rewrite rebuilds your history from the first commit, and it stops if random clutter files are sitting in the way. The good news: These are almost always auto-generated junk (caches, editor settings, system files) that's safe to delete and regenerates later:
Delete whatever the error named, for example: rm -f .DS_Store # deletes a file
rm -rf .Rproj.user __pycache__ .ipynb_checkpoints # deletes folders + contentsThen run the rebase command from Step 3 again. If it stops on different files, repeat, delete what it names, rerun, until you see Step 5: Check your commit history (both the ones available and missing from the contribution graph)git log --pretty=format:"%h %ad %ae" --date=short | head -20
Confirm: dates are unchanged, the emails match your verified email. Step 6: Push the rewritten historygit push --force-with-lease origin mainIf it's rejected with "stale info": git fetch origin
git push --force origin mainIf you get Step 7: Bring back stashed work (only if you used
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I accidentally removed my primary email, but I re-added it immediately and successfully verified it. However, all of my past contributions have disappeared and haven’t been restored.
Does anyone know how to fix this?
Beta Was this translation helpful? Give feedback.
All reactions