2

I'm starting using git and github.com. For a test, I created a repo using account1, then import and commit changes, pushed. All good. Then I created another account (account2), cloned them to another folder on my computer, made some changes then pushed.

Oddly enough, the 'git log' command shows that the author that did the last 'push' is account1, not account2. The comment is explicitly the one I made from account2, but the author is messed up.

The client I use is GitBash running on MINGW32, I already tried closing/restarting the clients several times, no hope. Anybody got the same problem? Tks

EyeQ Tech
  • 7,198
  • 18
  • 72
  • 126

2 Answers2

1

Check if your global config doesn't include user.email set to account1's email address.

The email address would be the parameter on which GitHub determines the author of a commit.

See as an illustration of this issue "Git author Unknown".

As mentioned in demas's answer, you need to set that information in the local git config for each repo: git config user.email ....
That way, even if you have a global config, you won't have any identification issue when you push from one or the other repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

You can set your email and name globally:

git config --global user.name    'Some Name'
git config --global user.email   'some.email@gmail.com'

Or just set them for current repository

git config user.name    'Some Name'
git config user.email   'some.email@gmail.com'
ceth
  • 44,198
  • 62
  • 180
  • 289