Hatefiend
Hatefiend

Reputation: 3596

GitHub - Pushed a change to master, but appears as different user than me?

I have a GitHub repo located here. I just commited a change to my repo and pushed to master branch, as I always do. I entered my account name and password, and the commit was pushed to GitHub. However, when I checked my GitHub commits page, I see a user that is not me.

Did I do something wrong? I'm on a new computer that just installed Git Bash. I usually use Git Bash on my laptop. Was I supposed to somehow identify myself on my Git Bash client before using repos? I'm so confused.

Upvotes: 2

Views: 55

Answers (1)

Mark Stosberg
Mark Stosberg

Reputation: 13381

The issue is more clearly seen if you look at the raw commit, which can be done by adding .patch to the normal commit URL. It shows this line:

From: User <User>

So it looks like some generic defaults got picked up. You may have entered your username and password as Github credentials which are separate from your identity that goes into your commit.

Follow the official Github instructions for setting your name and email address, which boils down to this command to set it globally:

git config --global user.email "[email protected]"

And this command for the local repo:

git config user.email "[email protected]"

Upvotes: 4

Related Questions