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:
- Right click on the repo folder, select TortoiseGit/Show Log.
- Click Statistics at the bottom of the dialog.
精彩评论