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.

2
  • The second answer of the question you linked yourself should help you to figure out how to get any result… Commented Aug 9, 2016 at 17:02
  • My original question was poorly worded. As it is now, this question is not a duplicate. Commented Aug 9, 2016 at 17:19

2 Answers 2

0

Did you try:

git log -n 1 --pretty=%B <treeish>
Sign up to request clarification or add additional context in comments.

2 Comments

Sorry, my question was poorly worded. I also want the commit, Author, and Date.
Look under "PRETTY FORMATS" at git-scm.com/docs/git-log
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"

Comments