git 的话参考这个
http://www.jianshu.com/p/8fd14064c201`git log --author="yourname" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -`
为啥是负的?...
> added lines: 333379, removed lines: 278437, total lines: 54942
> added lines: 5232, removed lines: 1338, total lines: 3894
> added lines: 2212, removed lines: 5934, total lines: -3722
> added lines: 5992, removed lines: 39007, total lines: -33015