Git统计代码行数的方法
右键菜单->Git Bash Here打开Git的命令行
查看项目每个人提交的代码行数统计,即执行
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --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 }' -; done
结果示例:
罗毅豪 added lines: 119259, removed lines: 34353, total lines: 84906