Dmytro Shevchenko
Dmytro Shevchenko

Reputation: 34641

How can I filter git log to show a list of specific revisions/commits?

Let's say I have several commits, and I know their revision IDs:

These commits are not consecutive, and aren't related to each other from git's perspective.

How can I output information about all of these commits in a list with a single command?

Upvotes: 1

Views: 589

Answers (2)

zigarn
zigarn

Reputation: 11625

Simply use git show:

git show aaaaaaa bbbbbb cccccc dddddd

You can use the --pretty=format:... to change the output and display each information you want of each commit on one line. Also --no-patch (or -s) to avoid displaying patch.

git show --no-patch --pretty='format:%h %aN %ad %s' aaaaaaa bbbbbb cccccc dddddd

Documentation: https://git-scm.com/docs/git-show

Upvotes: 5

jschnasse
jschnasse

Reputation: 9598

Try

git show -s aaaaaa bbbbbb cccccc dddddd

Upvotes: 2

Related Questions