How to get Git log with short stat in one line?

后端 未结 7 1523
無奈伤痛
無奈伤痛 2020-12-09 15:52

Following command outputs following lines of text on console

git log --pretty=format:\"%h;%ai;%s\" --shortstat
ed6e0ab;2014-01-07 16:32:39 +0530;Foo
 3 files         


        
相关标签:
7条回答
  • 2020-12-09 16:15

    I put something like this in my ~/.bashrc:

    function git-lgs() {
       git --no-pager log --numstat --format=%ai "$1" | sed ':a;N;$!ba;s/\n\n/\t/g' | sed 's/\(\t[0-9]*\t*[0-9]*\).*/\1/'
    }
    

    Where git-lgs's argument is the filename for which you want to display the log.

    0 讨论(0)
提交回复
热议问题