一个统计每个人git代码提交行数的命令
进入项目目录
printf "%25s %10s %10s %10s\n" "用户名" "总行数" "添加行数" "删除行数"
git log --format='%aN' | sort -u -r | while read name; do printf "%25s" "$name"; \
git log --author="$name" --pretty=tformat: --numstat | \
awk '{ add += $1; subs += $2; loc += $1 + $2 } END { printf "%15s %15s %15s \n", loc, add, subs }' \
-; done
printf "\n%25s " "总计:"; git log --pretty=tformat: --numstat | \
awk '{ add += $1; subs += $2; loc += $1 + $2 } END { printf "%15s %15s %15s \n", loc, add, subs }'
时间会记录下一切。