一、进入项目目录下(包含.git的目录)
![](https://img-blog.csdnimg.cn/20210407134725247.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4MTQwNTQ5,size_16,color_FFFFFF,t_70)
二、统计某个时间段内的git新增/删除代码行数
git log --since='2021-03-01' --before='2021-04-08' --pretty=tformat: --numstat | grep java | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -