gitgit-log

Show latest commit for a user across all branches


I tried to get the latest commit for a user using this command

git log --author=Jon

The returns a list of commits but they seem only to include commits made on this branch (incl. merges etc.)

How can I search across all branches for the latest commit of a particular user?


Solution

  • You just have to add the --all flag for that.

    It will take every existing branch tip as candidate for the search.


    And as a sidenote since you mentioned it, you can also filter merge commits if needed with --merges (merge commits only) / --no-merges (non-merge commits only)

    (doc)