MD XF MD XF - 27 days ago 16
Git Question

Account messed up on command line

I'm in a slight dilemma in which my GitHub account isn't working properly. Whenever I commit to a repository it shows that I pushed changes as 'prohacker112', an account I've never signed into. I'm using

credential-cache
, in which I signed in with my account and whenever it prompts me for a username/password I use my account. So why does GitHub think I'm committing/pushing as prohackr112? How can I tell Git my actual username? I'm using cloud9, if that helps.

Answer

The email address in your Git config is not set correctly.

To see the global Git email setting, run this command:

git config --global user.email

If this is incorrect, update it using this command:

git config --global user.email "<my email>@gmail.com"

If that setting is already correct, or correcting it doesn't fix your problem, check the local setting from within your local repo:

git config user.email

And, if incorrect, update it with this command:

git config user.email "<my email>@gmail.com"

GitHub's relevant documentation

Comments