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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With