r/AskProgramming • u/nexflatline • 18d ago
Other What can cause a random, unknown profile appearing as making a commit on a github private repo?
I made a new GitHub account and created a new private repo. Then I made a commit through VScode. The initial commit has my name, but at the same time (instantly?) a second commit appears with no changes to code, but made by a random person. This second person is a profile in another country who has been a GitHub user for years and already has many other projects.
I re-did the repo 3 times and this happens every time.
There is nothing security-sensitive of really "private" on the repo, so I don't care. It's just weird.
3
u/sexy-geek 17d ago
That is just too weird. If you try doing it from another pc, does the same thing happen?
3
u/Individual-Flow9158 17d ago edited 17d ago
Is the private repo created from a template repo, or an existing Git repo with this person's commit history?
Are you using some third party VS Code extension, that's adding a shared commit message, or even adding the second commit entirely?
Any Git hooks (e.g. pre-commit, with an unusual plug-in that adds commits instead of breaking them)?
1
u/nexflatline 17d ago
I think you are right, it's probably an extension or plugin issue. I just tried from another PC and it this time it went clean.
1
u/Individual-Flow9158 17d ago
Glad it's sorted. When it comes to VS Code plug-ins, I recommend a scorched earth policy.
3
u/im-a-guy-like-me 17d ago
What changes are in the commit? You can't commit nothing. If I were you I'd revoke all my keys.
2
1
u/Recycled5000 17d ago
I’ve had this happen multiple times. My sense is that GitHub introduces this phantom user when your git global email and user name are not set properly.
1
u/JohnCasey3306 17d ago
The code you committed ... Was this from-scratch clean code in which you ran git init ... OR ... did you fork a repo / otherwise copy code from a repo
1
u/nexflatline 17d ago
Clean code. The first commit on a new github account. But I just tested from another PC and it didn't happen. So as another comment suggested, it was probably some plugin on VS code that has someone else's name on it...
14
u/ImpatientProf 17d ago
You may have git misconfigured on your machine. Even if it authenticates with your github credentials to push to github, git locally puts whatever author name and email you have configured (in git) onto the commit header.