2

Is there any possible way to change the git log data format from "2019-08-22 06:38:34 +0000" to "20190822063834" in git log command itself or if any alternative options are great

git log  --pretty=format:"%ci" --decorate=full

2019-08-22 06:38:34 +0000
2019-08-22 06:38:34 +0000  
2019-08-22 06:38:33 +0000
2019-08-22 06:38:33 +0000
2019-08-22 06:38:32 +0000
2019-08-22 06:38:26 +0000

git log  --pretty=format:"%ci" --decorate=full

20190822063834
20190822063834
20190822063833
20190822063833
20190822063832
20190822063826
Vinoth
  • 189
  • 1
  • 1
  • 9

1 Answers1

1

You can try using a custom date format, as shown here:

git log --date=format:'%Y%m%d%H%M%S' --pretty=format:"%cd" --decorate=full

Note that I use %cd which respects --date= option, not %ci (ISO 8601-like format).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250