赞
踩
1.统计代码总行数
find . "(" -name "*.java" -or -name "*.xml" -or -name "*.properties" -or -name "*.yml"")" -print | xargs wc -l
2.统计指定用户的指定时间的修改数
git log --author=cglab --since=2021-04-26 --until=2021-05-09 --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 }'
3.统一指定时间的修改数
git log --since=2021-04-26 --until=2021-05-09 --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 }'
4.统计项目所有修改数
git log --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 }'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。