Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git show only author from commit hash?

Tags:

git

I can't seem to figure out how to print out only the author from a commit hash using git. This is what I have tried (and been trying to manipulate to get what I want). How can I make it so that it only prints out the author, as specified with the '%n'?

git show --pretty="format:<author>%an</author>"  --name-only cf81c4a41517bdc5514d381c5309b80f5f4ca226
like image 957
Busch Avatar asked May 09 '26 21:05

Busch


1 Answers

You want something like:

git show -s --pretty=%an cf81c4a41517bdc5514d381c5309b80f5f4ca226

From git help show:

   -s, --no-patch
       Suppress diff output. Useful for commands like git show that show the
       patch by default, or to cancel the effect of --patch.
like image 146
CB Bailey Avatar answered May 12 '26 09:05

CB Bailey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!