How can I specify maximum field lengths with git log? I want the output columns to be aligned.
You can specify the column width without using ANY external tool at all:
git log --format="%<(25,trunc)%ad | %<(25,trunc)%s | %<(25,trunc)%an"
There are TONs of other options, e.g.
%<|(25)
to align the output to columns. You can format columns to be left bound, right bound or even centered and so on: https://git-scm.com/docs/pretty-formats
Unfortunately I do not know when this has been added to git, I am using 2.10.1 on Windows…
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