0

I want the git log of a single commit but without the diff.

So far this is the simplest solution:

git log -1 <commit>

It looks like I want the -<number> switch. From the man page:

-<number>, -n <number>, --max-count=<number>
    Limit the number of commits to output.

This is not an exact duplicate of either of the listed questions.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • The second answer of the question you linked yourself should help you to figure out how to get any result… – poke Aug 09 '16 at 17:02
  • My original question was poorly worded. As it is now, this question is not a duplicate. –  Aug 09 '16 at 17:19

2 Answers2

0

Did you try:

git log -n 1 --pretty=%B <treeish>
David Neiss
  • 8,161
  • 2
  • 20
  • 21
0

You can try,

git log -n 1 --pretty=format:'%h %ad %s (%an)'

OR

git log -n 1 --pretty=format:"%h%x09%an%x09%ad%x09%s"
A l w a y s S u n n y
  • 36,497
  • 8
  • 60
  • 103