I recently created a new GitHub account and a private repository, then made an initial commit through VS Code. The first commit shows my name, but an additional commit appears almost immediately afterward with no code changes and is attributed to an unfamiliar person from another country. Their profile is several years old and contains many other projects. I recreated the repository three times, and the same thing happened each time. There is nothing sensitive in the repository, but I would like to understand how this could happen.
2 Answers
If there really are two separate commits, inspect the commit history and the timestamps carefully. A local Git configuration issue can explain the wrong identity, but it would not normally create an extra commit by itself. Try making a commit from a different computer or a clean environment, and review any VS Code extensions, hooks, or automated actions that might be creating the second commit. Also check whether the unfamiliar account is only being shown because the commit email matches their public GitHub account.
Check your local Git configuration, especially user.name and user.email. Git stores those values in each commit, and GitHub associates a commit with an account when the commit email matches that account. If your machine has an old or incorrect email configured, the commit may appear under somebody else’s profile even though your GitHub login was used to push it. Run git config --global user.name and git config --global user.email, then check the repository-level settings too.

That makes sense. I’ll compare the commit details and test with a clean machine to determine whether this is just an author-email mismatch or something generating an additional commit.