12

When a commit has multiple parents, like this one, we see that it has 4 additions and 4 deletions. My question is compared to what? Are the additions and deletions compared to the file as it existed in BOTH parents? Or how exactly is it compared?

Shamoon
  • 38,429
  • 77
  • 269
  • 518

1 Answers1

12

It is a three-way merge between:

(you can see another example of three-way merge in this answer)

By convention, GitHub will always display the parents as:

  • The first parent, which is the branch you were on when you merged,
  • and the second parent, which is the commit on the branch that you merged in.

Compared to the common ancestor of those two commits, the second one, when merged into the first one, brings 4 additions and 4 deletions.

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
  • is there any way of identifying whether each commit is a merge commit or are there are mulitple parents to that commit in github API level – Kasun Siyambalapitiya Apr 17 '17 at 12:00
  • From `man git-merge` it says that `git-merge - Join two or more development histories together` which may lead to multiple parent commits ( more than 2) for a certain commit. in that case how the stats are calculated – Kasun Siyambalapitiya Apr 17 '17 at 12:33
  • can you please have a look on this question http://stackoverflow.com/questions/43452249/how-to-indentify-which-commit-introduce-which-changes-in-a-octopuss-merge/43453033#43453033 – Kasun Siyambalapitiya Apr 18 '17 at 03:12
  • 1
    @KasunSiyambalapitiya I have, and agree with torek's comment. – VonC Apr 18 '17 at 04:26