A colleague did a git merge. We use Github. I can only see who the developers were who made the last commits. Is there a way to determine who made a merge?
-
1The merge was committed; the person who committed presumably did the merge, did they not? – Jonathan Leffler Jun 20 '16 at 14:50
-
1It sounds like this was a fast-forward merge. With one, there's no merge commit to be had since everything could merge cleanly. – Makoto Jun 20 '16 at 14:51
-
1Did merge create commit? – ThiepLV Jun 20 '16 at 15:00
-
Commits were made to various branches by different developers. However, the person who did the merge did not have any commits. There is no transaction indicating that this person made the merge. Only the names of the developers who made commits is shown. Would be nice to know who did the merge. I couldn't find anything in the Git docs that indicate recording the user who performs merges. – Johann Jun 20 '16 at 15:13
1 Answers
There are two different scenarios for merging:
In the first scenario, Bobby made some changes based on Commit 1, but not before Susie pushed a few changes of her own:
Commit 1
| \
| Commit 2 by Susie, merged to master
| \
Commit 3 by Bobby on branch |
| /
Commit 4 by Bobby: Merged to master
In this scenario, when Bobby attempts to merge commit 3 to master, git determined that since the changes are not linear, a merge commit is necessary. This commit is automatically created with Bobby's name on it, making it very obvious that he did this.
The second scenario is a fast forward:
Commit 1 - Head of Master
| |
| Commit 2 by Bobby on branch
| |
| Commit 3 by Bobby on branch
| /
Merge to master: since Bobby's base commit is still the head, fast-forward is used:
Commit 1
|
Commit 2 - Bobby
|
Commit 3 - Bobby
Fast forward makes the tree appear linear, all of the commits in Bobby's branch are made to look as if they were made directly on master. This view is cleaner, but there is no merge commit with Bobby's name on it. If you are looking for a specific change however, Bobby's name is still on the commits.
Since your dev performed a 0 commit merge, it's likely that git automatically did nothing, or used a fast forward (of 0 commits), which would not produce a merge commit.
A generic git solution might be to disable fast-forward functionality so that merge is always shown in the tree, this SO answer will tell you what you need. This will allow any merge to be visible, at the cost of a slightly more ugly looking history.
Alternatively, since you are using Github, that has the ability to Fork repos and then set up pull requests, which I believe maintains a history of such requests as well as convenient tools for code review (you are reviewing each others code, right?) and merging. All you need to do is adjust your git workflow and procedures to take advantage of that.

- 1
- 1

- 1,655
- 11
- 26