Reputation: 527
I can specify custom date format for git log
git log --reverse --date=format:'%Y-%b-%d %H:%M:%S'
but when I try to save this in .gitconfig
, it has no effect
[format]
date = format:'%Y-%b-%d %H:%M:%S'
How can I customize my date format in .gitconfig
?
also, how can I save --reverse
in .gitconfig
?
Upvotes: 2
Views: 170
Reputation: 7696
Try specifying date=format
for log
command and not format
as below
[log]
date = format:'%Y-%b-%d %H:%M:%S'
For specifying --reverse
you can use alias
like below:
[log]
date=format:'%Y-%b-%d %H:%M:%S'
[alias]
lg = log --reverse
After these changes your git log
will print with the specified format and when you write git lg
will be printed git log
with --reverse
.
Upvotes: 2