右键点击Git Bash Here
查看代码提交次数
git log --since='2022-7-1' --before='2022-8-1' --author="XXXX" --pretty='%aN' |sort |uniq -c | sort -k1 -n -r
查看代码提交行数
git log --since='2022-8-1' --before='2022-9-1' --author='XXXX' --pretty=tformat: --numstat |awk '{add +=$1 ; subs +=$2; loc += $1 + $2} END {printf "added lines: %s , removed lines: %s\n" , add , subs}'
所有人指定时间内 --since=2022–09-01 --until=2022-10-01 代码提交行数
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --since=2022–09-01 --until=2022-10-01 --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
所有人指定时间内 --since=2022–09-01 --until=2022-10-01 代码提交行数
指定.vue文件 | grep '.vue'
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --since=2022–09-01 --until=2022-10-01 --numstat | grep '.vue' | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
指定时间内有代码提交记录人的 --since=2022–09-01 --until=2022-10-01 代码提交行数
git log --since=2022-09-01 --until=2022-10-01 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --since=2022-09-01 --until=2022-10-01 --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