简体   繁体   中英

Why does github detect two authors but not sourcetree?

So basically I did an git --amend --no-edit from a second computer, tho I do have the same name and email on git, and Github detected a second author, while Sourcetree does not show me any second author.

If I execute git log --format='%aN' | sort -u git log --format='%aN' | sort -u , which would show me all the authors, only one appears, just like in Sourcetree.

Why is this?

Here are some screenshots:

在此处输入图片说明

在此处输入图片说明

Because the git Metadata of a commit contains 2 informations that is 'author' (in spirit, the one that write the code) and 'committer' (the one that create the commit).

And the case of this commit, the 2 data are different (because that's a merge commit made through a github pull request. I don't remember exactly what github do but it seems logical to me that the author should be the one that create the pull request and the commiter the one that merge it).

FYI, most of the times, the 2 data are the same. That's the case when you create a normal commit.

But the commiter data could change when you rebase the commit created by someone else.

Github decided to display the 2 information but sourcetree, in the commit list decided to display only the 'author' field (but in the commit detail vue, you could see it) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM