Difference between commit made on github site and command line

1

Problem

Different contributors to the same account in the repository.


History

When I created the repository, I uploaded some files through github's own site and the commits were registered as mine. However, when I made commits from the command line and then pushed, it appeared on the github website as if it were somebody else doing the commit. But it's the same account that I uploaded initially.


Suspicious

I suspect that other commits have been "verified" with GitHub's GPG Key. But I do not know what it is and so far I have not been able to send commits signed by the command line.


Illustration:

    
asked by anonymous 13.12.2018 / 18:24

1 answer

1

This can happen for two reasons:

1st You did not set your email in git

If this is the case, you need to set your email in your local git configuration. Check your current email with

$ git config user.email

And set your email with

$ git config user.email “[email protected]

Note that this will only affect new commits. Previous commits will remain the same.

2º You are using a different email than what was configured in github

This happens when you are contributing to a private repository on a working computer, for example, and you have set up git to use your work email instead of your usual github email.

There are two ways to fix this:

  • Go to Github Settings > Emails > Add address e-mail address and add your work email address here to link the commits made from a local git set up with your work email for your normal github account.
  • Change your local git setting to use your primary email from github
13.12.2018 / 20:57