Alexander Zeitler
Alexander Zeitler

Reputation: 13089

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?

Upvotes: 2

Views: 54

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 21908

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)

Upvotes: 4

Related Questions