git查看提交行数、删除行数

2020-12-30 17:40:48 浏览数 (1)

统计指定用户提交代码情况

代码语言:javascript复制
git log --author="你的名字" --pretty=tformat: --numstat | awk '{ add  = $1; subs  = $2; loc  = $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %sn", add, subs, loc }' -

统计每个人的代码提交情况

代码语言:javascript复制
git log --format='%aN' | sort -u | while read name; do echo -en "$namet"; 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: %sn", add, subs, loc }' -; done

0 人点赞