Reputation: 3921
How to extract just the commit message using git rev-list command?
I tried git rev-list --format=%B --pretty=oneline -n 1 , but it prints the whole thing in 1 line.
Upvotes: 0
Views: 1214
Reputation: 1183
$ git rev-list --format=%B --max-count=1 <commit>
would print out commit message and commit sha
$ git log --format=%B -n 1 <commit> | cat -
would print out commit message and no commit sha
Upvotes: 1