Arthur Green
Arthur Green

Reputation: 146

Export a git commit log to csv using short dates

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

Upvotes: 3

Views: 3391

Answers (1)

Bertrand Martel
Bertrand Martel

Reputation: 45352

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

Upvotes: 4

Related Questions