git code amount statistics tool -- 2017-12-20

1. Count the number of lines of code submitted by users by time range

 Code commit lines since 2017-01-01:

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --since='2017-01-01' --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

 

2. Count the number of user submissions by time range

Number of submissions since 2017-01-01:

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --no-merges --since='2017-01-01' |  grep -e 'commit [a-zA-Z0-9]*' | wc -l;done

 

You can refer to the article: http://blog.csdn.net/maosidiaoxian/article/details/24401103 , add the above command to the command line

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326109423&siteId=291194637