0

我正在尝试使用 --date=format:'%Y%b%d' 以 2021April09 格式打印提交日期,但它给了我分段错误。即使对于标准格式,以下任何一项都不适合我。

git log --pretty=format:%cd --date=format:%Y%m%d -5

git log --pretty=format:%cd --date=format:'%Y-%m-%d' -5

我知道我可以git log --pretty=format:%cd --date=short用来获取较短的版本,但我想使用 strftime 格式打印缩写月份等

4

2 回答 2

0

git log --pretty=format:%cd --date=format:%Y%m%d -5

git log --pretty=format:%cd --date=format:'%Y-%m-%d' -5

Both of the above works fine from a CMake based command invocation but won't work for me from Git BASH on windows (MINGW32). I also tried updating Git the latest 2.31.x.

I keep getting segmentation fault. I have moved on to something else but will be looking at this thread to see if anyone else has any suggestion. Thanks

于 2021-04-13T17:13:46.030 回答
0
git log --pretty='%cd' --date=format:'%Y/%m/%d' 

试试这个

于 2021-04-10T02:11:44.003 回答