Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export a git commit log to csv using short dates

Tags:

git

Consider the command

git log --pretty=format:'"%h","%an","%aD","%s",' > log.csv

This works perfect, but I can't seem to figure out where to add the --date=short that is located within the github documentation

like image 629
Arthur Green Avatar asked Jun 14 '26 14:06

Arthur Green


1 Answers

From pretty-formats git documentation, %aD is RFC822 style whereas %ad is the one that takes into account --date= option :

'%ad': author date (format respects --date= option)

'%aD': author date, RFC2822 style

git log --date=short --pretty=format:'"%h","%an","%ad","%s"' > log.csv
like image 137
Bertrand Martel Avatar answered Jun 16 '26 06:06

Bertrand Martel



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!