Reputation: 3251
In the following picture, you can see that I created a repository on http://github.com. This "commit" is connected with my Github account (exactly what I want).
But then, I used the terminal on my MacBook and made a commit, but in this case, this commit is connected with my real first- and last name.
In my Terminal:
git push origin master
I was asked then:
Username for 'https://github.com'
and
Password for 'https://[email protected]
I answered those questions but the commits were created by this account with my real name...
How can I use my Github Account on my PC instead of this other account?
Upvotes: 2
Views: 352
Reputation: 310
Your github account can have different information than your local repository. The mail you use in your git config must also be in your github account (https://github.com/settings/emails)
Look your git user name and your user email with :
$ git config user.email
$ git config user.name
Look the user name and the mail use by your github account
$ git log
You have to configure your name and your mail for you local repository.
$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
// global is for all your local git repository
more information https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
You can see the git configuration file ~/.gitconfig
Upvotes: 4