开发者

count line changes with git?

Is there a simple way I c开发者_运维百科an ask git for the amount of lines I added (or add and removed) in a specific date range?

I'm using git on Windows, Linux and TortoiseGit(Windows)


Building upon Seth Robertson's answer, (+1 Seth!) awk will tally up the columns for you:

% git log --stat --author $(git config --get user.email) --since="last year" --until="last month" | awk -F',' '/files? changed/ {
    files += $1
    insertions += $2
    deletions += $3
    print
}
END {
    print "Files Changed: " files
    print "Insertions: " insertions
    print "Deletions: " deletions
    print "Lines changed: " insertions + deletions

}'

 


git log --stat --author me --since="last year" --until="last month"

You can then post-process the --stat information at the bottom.


In case someone is interested in an overall statistics of the repo:

  1. Right click on the repo folder, select TortoiseGit/Show Log.
  2. Click Statistics at the bottom of the dialog.

    count line changes with git?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜