Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Short dates in .gitconfig

Tags:

git

git-config

If I add

[format]
  pretty = format:%h %ad %s

to my ~/.gitconfig and enter git log I get:

36f6ac2 2016-05-22 08:55:55 2016 -0400 Wrapped up optimization of network flow.
37b1037 2016-05-19 07:47:29 2016 -0400 Prepared code to be ready for network flow optimization.
476de11 2016-05-18 18:06:45 2016 -0400 Identified a weakness in the code. Must optimize network flow.

If I enter git log --date=short I get:

36f6ac2 2016-05-22 Wrapped up optimization of network flow.
37b1037 2016-05-19 Prepared code to be ready for network flow optimization.
476de11 2016-05-18 Identified a weakness in the code. Must optimize network flow.

Is it possible to set the --date=short part permanently in ~/.gitconfig?

like image 978
Calaf Avatar asked Jun 14 '26 01:06

Calaf


1 Answers

To keep it short, you can execute

git config --global log.date short

or manually add this to your .gitconfig

[log]
    date = short