How to get merge log for branch?

git loglists all commits from all branches that have been merged into HEAD. I want to get a list of merges, so I can see which branches were merged into this, and when.

How can I get this information? I am looking for something other than “run gitk and look at the graph”, since I know this, but for very large stories with many branches, it does not scale very well. The text result for a text query is probably perfect.

+3
source share
2 answers

With modern git (if you have version 1.6.4 or newer you have this), you can simply use

$ git log --merges

, --first-parent:

$ git log --merges --first-parent
+4

, git :

$ git log --no-walk $(git rev-list --parents HEAD | sed -n "s/ .* .*//p")

.
, .

+2

Source: https://habr.com/ru/post/1717588/


All Articles