threads / bug / 44364

Reporting Bug in Git Version Control System

Subject: Reporting Bug in Git Version Control System

## tl;dr

6 messages between Oct 24, 2016 and Oct 31, 2016.

replies: 5people: 5as markdown or json

Yash Jain· Oct 24, 2016, 14:28 UTC · lore

Hello, I have two accounts on github("yj291197" and "yaki29"). Both the accounts have different gmail IDs("yj291197@gmail.com" and "yashjain.lnm@gmail.com" respectively) but same passwords. I used to use git for "yj291197" account and a few days earlier I made this new account and used git commit to commit on "yaki29" but it appeared as "yj291197" committed on "yaki29's" repo. Then I pulled a request of that commit then it appeared "yaki29" pulled a request with a commit of "yj291197".

And during this whole session I was signed in as "yaki29" on github.com .
Please reply ....
Stefan Beller· Oct 24, 2016, 18:23 UTC · re: Yash Jain · lore

Re: Reporting Bug in Git Version Control System

This is a Github issue, so ask Github support.
Or read up on .mailmap files.
On Mon, Oct 24, 2016 at 7:28 AM, Yash Jain <yashjain.lnm@gmail.com> wrote:
Show 16 quoted lines
> Hello,
> I have two accounts on github("yj291197" and "yaki29").
> Both the accounts have different gmail IDs("yj291197@gmail.com" and
> "yashjain.lnm@gmail.com" respectively) but same passwords.
> I used to use git for "yj291197" account and a few days earlier I made
> this new account and used git commit to commit on "yaki29" but it
> appeared as "yj291197" committed on "yaki29's" repo.
> Then I pulled a request of that commit then it appeared "yaki29"
> pulled a request with a commit of "yj291197".
>
>
>
> And during this whole session I was signed in as "yaki29" on github.com .
>
>
> Please reply ....
Junio C Hamano· Oct 24, 2016, 18:32 UTC · re: Stefan Beller · lore

Re: Reporting Bug in Git Version Control System

Stefan Beller <sbeller@google.com> writes:
Show 17 quoted lines
> On Mon, Oct 24, 2016 at 7:28 AM, Yash Jain <yashjain.lnm@gmail.com> wrote:
>> Hello,
>> I have two accounts on github("yj291197" and "yaki29").
>> Both the accounts have different gmail IDs("yj291197@gmail.com" and
>> "yashjain.lnm@gmail.com" respectively) but same passwords.
>> I used to use git for "yj291197" account and a few days earlier I made
>> this new account and used git commit to commit on "yaki29" but it
>> appeared as "yj291197" committed on "yaki29's" repo.
>> Then I pulled a request of that commit then it appeared "yaki29"
>> pulled a request with a commit of "yj291197".
>>
>> And during this whole session I was signed in as "yaki29" on github.com .
>>
>
> This is a Github issue, so ask Github support.
>
> Or read up on .mailmap files.

I am (obviously) not a GitHub support, but I think the confusion is coming from not understanding who the committer and the author of a commit are and where they are coming from. They are both recorded locally, taken from user.name and user.email configuration variables when the commits are made. "git push" to propagate them to GitHub will NOT change these values of a commit, once a commit is created.

The story described looks quite consistent if the user has yj291197@gmail.com configured as user.email and kept making commits in the local repository, and pushed them to either yj291197 or yaki29 accounts at GitHub, without ever changing the local configuration to use the other e-mail address. All commits would record the user and e-mail address yj291197, and the only one that may be attributed to the new one yaki29 would be the automerge created at GitHub when a pull request is responded on-site without first fetching and making a merge locally.

Junio C Hamano· Oct 24, 2016, 21:14 UTC · re: Junio C Hamano · lore

Re: Reporting Bug in Git Version Control System

Junio C Hamano <gitster@pobox.com> writes:
Show 36 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> On Mon, Oct 24, 2016 at 7:28 AM, Yash Jain <yashjain.lnm@gmail.com> wrote:
>>> Hello,
>>> I have two accounts on github("yj291197" and "yaki29").
>>> Both the accounts have different gmail IDs("yj291197@gmail.com" and
>>> "yashjain.lnm@gmail.com" respectively) but same passwords.
>>> I used to use git for "yj291197" account and a few days earlier I made
>>> this new account and used git commit to commit on "yaki29" but it
>>> appeared as "yj291197" committed on "yaki29's" repo.
>>> Then I pulled a request of that commit then it appeared "yaki29"
>>> pulled a request with a commit of "yj291197".
>>>
>>> And during this whole session I was signed in as "yaki29" on github.com .
>>>
>>
>> This is a Github issue, so ask Github support.
>>
>> Or read up on .mailmap files.
>
> I am (obviously) not a GitHub support, but I think the confusion is
> coming from not understanding who the committer and the author of a
> commit are and where they are coming from.  They are both recorded
> locally, taken from user.name and user.email configuration variables
> when the commits are made.  "git push" to propagate them to GitHub
> will NOT change these values of a commit, once a commit is created.
>
> The story described looks quite consistent if the user has
> yj291197@gmail.com configured as user.email and kept making commits
> in the local repository, and pushed them to either yj291197 or yaki29
> accounts at GitHub, without ever changing the local configuration to
> use the other e-mail address.  All commits would record the user and
> e-mail address yj291197, and the only one that may be attributed to
> the new one yaki29 would be the automerge created at GitHub when a
> pull request is responded on-site without first fetching and making
> a merge locally.

IOW, this sounds like Pebkac to me. There is no a thing that needs fixing in Git, and I do not immediately see there is anything GitHub needs to fix, either. The user may need fixing, though ;-).

Pranit Bauva· Oct 25, 2016, 08:51 UTC · re: Yash Jain · lore

Re: Reporting Bug in Git Version Control System

Hey Yash,

Junio has explained the problem very well. Since you seem to be a beginner (guessing purely by your email) I will tell you how to fix it.

Remember when you would have first installed git, you would have done something like `git config --global user.name <what ever name>` and `git config --global user.email <what ever email>`, it gets permanently stored in the git configuration file (~/.gitconfig). Now all the commits in git are made with this name and email. If you want to change this, again run the above commands with your new name and email. After that commits will be done with a different name and email. Hope this helps! :)

Regards, Pranit Bauva

Jakub Narębski· Oct 31, 2016, 16:09 UTC · re: Pranit Bauva · lore

Re: Reporting Bug in Git Version Control System

W dniu 25.10.2016 o 10:51, Pranit Bauva pisze:
Show 14 quoted lines
> Hey Yash,
> 
> Junio has explained the problem very well. Since you seem to be a
> beginner (guessing purely by your email) I will tell you how to fix
> it.
> 
> Remember when you would have first installed git, you would have done
> something like `git config --global user.name <what ever name>` and
> `git config --global user.email <what ever email>`, it gets
> permanently stored in the git configuration file (~/.gitconfig). Now
> all the commits in git are made with this name and email. If you want
> to change this, again run the above commands with your new name and
> email. After that commits will be done with a different name and
> email. Hope this helps! :)

First, per user Git configuration doesn't necessarily go into ~/.gitconfig; it could be in ~/.config/git/config

Second, you can configure user.email and user.name with `git config` or `git config --local`. The information would go into .git/config for specific repository. This might be a better solution if you want different settings for different repositories.

-- 
Jakub Narębski

← back to recent threads