Difference between commit done on the github website and on the command line

Asked

Viewed 146 times

1

Problem

Different contributors to the same account in the repository.


Historic

When I created the repository, I uploaded some files from the github site itself and the commits were registered as mine. However, when I committed from the command line and then pushed, it appeared on the github site as if someone else was doing the commit. But it’s the same account I uploaded initially.


Suspicious

I suspect it may be because the other commits were "checked" with Github’s GPG Key. But I don’t know what it is and so far I haven’t been able to send commits signed from the command line.


Illustration:

Foto com alguns commits

  • executes this command and see if the registered email is the same as in github: git config user.email. I await your return.

  • At the moment there was no output because I reinstalled Git today. I will re-subscribe my data here.

1 answer

1


This can happen for two reasons:

1º You didn’t set your email in git

If that’s the case, you need to set your email in your local git configuration. Check what your current email is with

$ git config user.email

And define your email with

$ git config user.email “[email protected]

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

2º You are using an email different from the one set up in github

This happens when you’re contributing to a private repository on a work computer, for example, and you 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 email and add your work email address here to link the commits made from a local git configured with your work email for your normal github account.
  • Change your local git configuration to use your main email github
  • Solved. What was happening was the second option. Actually, I was using an email that is mine, but I wasn’t registered on github. I thought this email was from github. Anyway, thank you very much. And sorry for the silly problem.

  • 1

    All doubt is valid, as long as it is legitimate.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.