Search code examples
gitgit-mergegit-commitpull-request

Which git command give me only merge commits for the master branch?


I just merged PR to the master.

I want to log all the merges commits.

So which git command give me only merge commits for the master branch?


Solution

  • Using merges flag

    $ git log --merges


    Using grep

    $ git log | grep '^Merge:' -B 1 -A 5
    

    This will show you a list of the merge commits