Can merged commits with a malformed author email be attributed without rewriting history? #207958
Replies: 5 comments
|
Since the malformed email address is already stored in the merged commits, changing your local Git configuration will only fix future commits. GitHub normally associates commits with an account when the commit’s author email matches an email associated with that GitHub account. Because the historical commits contain the literal ** characters, adding the intended user@example.com address would not match user@example.com. As far as I know, there isn’t a way to change the author metadata of existing commits without changing/re-writing those commits. Since these commits are already merged into an upstream shared repository, rewriting the history just to fix attribution would probably not be worth the disruption. Your best option may be to leave the historical commits as they are and make sure your corrected user.name and user.email are used for future contributions. You can verify what Git is currently using with: git config --global user.name git config --global user.email Also check the repository-level configuration, since it can override your global configuration: git config --local user.name git config --local user.email |
|
No—there is no supported aliasing mechanism for that malformed historical address. GitHub attributes a commit by exact author email. The literal address The two possible outcomes are therefore:
GitHub's own guidance says changing author information in existing commits requires rewriting history and warns against doing that in a shared repository except when truly necessary. A mailmap can improve names in local Given that the PR is already merged, leaving history intact is the safer choice. Verify both scopes for future commits:
This catches a repository-level setting that silently overrides the corrected global value. |
|
I believe the main issue is that GitHub matches a commit to an account using the exact email address stored in the commit metadata. Since the commits contain -user@example.com, adding user@example.com to your GitHub account wouldn't match those historical commits. If GitHub allows that exact malformed address to be added and verified, that would be worth trying, but GitHub also has restrictions on which email addresses can be added. Otherwise, I don't think there's a way to manually re-attribute an already-pushed commit without changing its author metadata. Rewriting the commits would create new commit IDs and would require rewriting/force-pushing the affected history. Since the PR is already merged into the upstream default branch, I'd avoid rewriting the shared history just for contribution attribution. The safest approach is probably to leave those commits as they are and make sure your Git email is correctly configured for future commits. You could also mention the exact malformed email to GitHub Support and ask whether they can associate it with your account, since the normal email-linking process requires an exact match. Regards, |
|
Adding a bit to the existing answers: the reason you can't add and verify that exact malformed address on your GitHub account is that a domain like Two practical options beyond "leave it as-is":
|
|
any one here melbourne i dont know what happening
…On Thu, 17 Sep 2026 at 07:25, Felipe Bridge < ***@***.***> wrote:
Adding a bit to the existing answers: the reason you can't add and verify
that exact malformed address on your GitHub account is that a domain like
example.com** (with trailing characters after the domain) isn't a
syntactically valid email — GitHub's email verification will reject it
outright, so there's no "backdoor" via account settings even if you wanted
to try it.
Two practical options beyond "leave it as-is":
1. Ask the upstream maintainer to add a .mailmap file to the repo
mapping the malformed identity to your correct name/email. This won't fix
the GitHub contribution graph or the commit author avatar (those are driven
purely by verified account emails), but it will fix attribution in git
shortlog, git log --use-mailmap, git blame, and any tooling that reads
the repo's git history — which is often what actually matters for
changelogs/release notes.
2. If graph credit matters to you specifically, ask the maintainer to
add your username to a CONTRIBUTORS.md/AUTHORS file as a manual
acknowledgment, since that's the only "credit" option left that doesn't
touch shared history.
—
Reply to this email directly, view it on GitHub
<#207958?email_source=notifications&email_token=CLYHAMDOPXSEESUB2QLZQWT5PMALJA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBUG4YTOOJQUZZGKYLTN5XKU43VMJZWG4TJMJSWJJLFOZSW45FMMZXW65DFOJPWG3DJMNVQ#discussioncomment-18471790>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CLYHAMFGEW6K4GX7HIXJZEL5PMALJAVCNFSNUABIKJSXA33TNF2G64TZHMZTAMJVG4ZTGNBUHNCGS43DOVZXG2LPNY5TCMBYGIYTCOJQUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CLYHAMFBD3EWV77QXW4CAIT5PMALJA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBUG4YTOOJQUZZGKYLTN5XKU43VMJZWG4TJMJSWJJLFOZSW45FKMZXW65DFOJPWS33T>
and Android
<https://github.com/notifications/mobile/android/CLYHAMBFJTLF2HQM7IPHDSL5PMALJA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBUG4YTOOJQUZZGKYLTN5XKU43VMJZWG4TJMJSWJJLFOZSW45FOMZXW65DFOJPWC3TEOJXWSZA>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
Hi everyone,
My GitHub username is Matey-ace. My PR was merged into the upstream repository’s master branch, but four contributions are listed as anonymous.
PR: MacchaPafe/D_sakiko#27
Example commit: MacchaPafe/D_sakiko@07346cf
The cause is an incorrect local Git configuration: literal asterisks were included in both the author name and author email.
Using a placeholder address, the email stored in the commits has this exact pattern:
**user@example.com**The intended email has this pattern:
user@example.comThe asterisks are actual characters in the commit metadata, not Markdown formatting. In particular, there are two asterisks after the email domain.
I have corrected my local Git configuration, but this does not change the existing merged commits.
Is there any supported way to associate these historical commits with my account without rewriting the upstream repository’s shared history? Adding the intended email would not exactly match the malformed address stored in the commits.
GitHub Support closed my ticket based on the support options available to my account and directed me to the Community, without resolving the attribution question.
Thank you.
All reactions