How can I make git log order based on author's timestamp?

后端 未结 4 490
迷失自我
迷失自我 2020-12-04 23:16

I use a fairly complex git-log command involving --date-order to get an overview of my repository\'s status; but unfortunately, --date-order<

4条回答
  •  眼角桃花
    2020-12-05 00:04

    Okay, this took me a very long time to figure out (details). In short, I found many examples that were either incomplete or incorrect. The following command does what I think you would expect:

    $ git log --pretty="format:%at %C(yellow)commit %H%Creset\nAuthor: %an <%ae>\nDate: %aD\n\n %s\n" | sort -r | cut -d" " -f2- | sed -e "s/\\\n/\\`echo -e '\n\r'`/g" | tr -d '\15\32' | less -R
    

    You can find this script and others in Git Extras on GitHub.

提交回复
热议问题