Contribution graph showing duplicate commits after history rewrite #189036
-
Select Topic AreaQuestion BodyI rewrote the git history on one of my repos to remove a commit, then force-pushed to master. The contribution graph is now wrong number of commits. I believe this happened because GitHub logged contributions for each version of the rewritten commits as separate events. Is there a way to recalculate or correct the contribution data for this repository? Waiting doesn't seem to help though |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
|
Hey @mateeeeeee, you're exactly right. Because of how GitHub logs events, those rewritten commits got new IDs and were counted as brand new contributions, but the old ones weren't automatically subtracted when you force-pushed. Unfortunately, there is no magic button on our end to force a recalculation. Your best bet is to wait about 24 hours to see if GitHub's internal cleanup jobs catch the orphaned commits. If your graph is still wrong after that, you should reach out to GitHub Support at https://support.github.com/. They have the tools to manually rebuild your contribution graph from their side. The only other "guaranteed" way to clear it up yourself is to completely delete and recreate the repository. But that obviously comes with a lot of messy side effects like losing issues and PRs, so asking Support is definitely the safer route! |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Here are the steps to resolve this:
Your GitHub username Repository URL Date of the force-push Affected date range (where graph shows wrong counts) Explanation that commits were rewritten via rebase and force-pushed Confirmation that local git log shows correct history The support team can manually reindex your contribution graph to clear the cached entries from deleted commits . |
Beta Was this translation helpful? Give feedback.
-
|
accept the answer |
Beta Was this translation helpful? Give feedback.
-
|
Go to Repositories > Repositories - Features and submit a ticket. For the subject, use: "Incorrect commit count after history rewrite" |
Beta Was this translation helpful? Give feedback.



@mateeeeeee I see. In that case, just go ahead and click on Repositories > Repositories - Features.
When you fill out the ticket, just tell them you did a history rewrite and a force-push, and now your repository's total commit count is wrong because it's still including the old orphaned commits. Just ask them to clear those orphaned commits so the count is accurate again. The support team will know exactly what to do behind the scenes to fix your numbers!
For the subject line, you can just put something simple like "Incorrect commit count after history rewrite".
For the main description box, you can paste this: "I rewrote my repository's history and force-pushed. The total commit count i…