git log –since==2019-01-01 –until==2019-12-31 –format=’%aN’ | sort -u | while read name; do echo -en “$name\t”; git log –since==2019-01-01 –until==2019-12-31 –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
转载请注明:学时网 » git统计代码量脚本