❓ Strange Contributor Listed on Repository, Conflicting with Settings and Commit History :/ #181821
Replies: 2 comments
-
|
This isn’t actually someone getting access to your repo; it’s almost certainly commit attribution, not collaboration or hijacking. A few important clarifications first:
So what’s happening is: How to diagnose it properly:
git show -s --format=fuller <commit-sha>Look carefully at both the Author and Committer name + email.
git config --show-origin --get user.name
git config --show-origin --get user.emailIf the output points to
GitHub only links commits to accounts based on verified emails. If that email is not verified on your account, or is verified on someone else’s account, GitHub will show their username and avatar on the commit.
You didn’t start from a clean folder; you started from a ZIP export that already included a This happens more often than people think, especially if:
Why it looks like “authorship hijacking” on GitHubThe
So even if GitHub doesn’t guess who authored a commit based on who pushed it; it uses the author email inside the commit. If that email is verified on the unknown user’s GitHub account, GitHub will show their avatar/name on the web UI. |
Beta Was this translation helpful? Give feedback.
-
Explanation: Unknown Contributor & Commit Author MismatchThis document explains why an unknown user may appear as a contributor in a GitHub repository and why commits may appear authored by another user.
Why an Unknown User Appears as a ContributorGitHub defines a contributor as any account whose email appears in commits within the repository.
Therefore:
Why Commits Appear Authored by Another UserGitHub determines commit authorship only by the commit email, not by who pushed the commit. GitHub's Process:
This means one or more of the following is true:
There is no mechanism for a remote user to hijack commit authorship based on this behavior. How to ConfirmInspect an affected commit using the command line: Check these fields in the output: If either email matches an email verified on another GitHub account, GitHub will attribute the commit to that account. How to Fix1. Set the Correct EmailUse an email address that is verified on your specific GitHub account. Global configuration (recommended): Optional (per repository): 2. Fix Past Commits (If Needed)To fix the most recent commit: Final Reassurance
SummaryConcern | Explanation -- | -- Unknown contributor | Commit email attribution Authorship mismatch | Email matches another account No collaborators | Correct and expected |
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
Body
Hello community, I am encountering a bizarre and concerning issue on one of my personal repositories and I'm hoping someone can shed some light on what might be happening.
I have a repository where a strange, unknown user is being displayed as a contributor in several places, even though they were never explicitly invited or added.
The Conflict
Here are the specific, conflicting details I'm observing:
Repository Contributors List (Main Page): The unknown user's avatar and name appear in the list of contributors displayed on the main repository page (often in the sidebar or under "Contributors").
Settings Confirmation (Correct): When I go to the repository's Settings > Collaborators and teams, it correctly states: "There are no collaborators in this repository." This confirms I have not explicitly added them.
Commit History Hijack (Most Puzzling): Whenever I push a commit from my local VS Code environment, even though the local commit details (checked via git log) clearly show my name and my email address, the commit on the GitHub web interface is displayed as being made by this strange user. This is the most alarming part.
Actions Taken So Far
I have verified my local Git configuration to ensure my name and email are correct:
git config user.name (Correct - my name)
git config user.email (Correct - my email tied to my GitHub account)
I have ensured I am logged into my own GitHub account in VS Code.
I have checked for any unusual actions or webhooks in the Settings > Webhooks menu (none present)
SO,
How is it possible for an uninvited user to appear as a contributor, and more critically, hijack the authorship of my local commits when my Git configuration is correct and verified?
Any advice on how to diagnose and resolve this would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions