git log统计个人代码量,排除多个文件夹

网上找了半天,没有找到排除文件夹和格式化输出同时出现的代码。这里是自己试出来的代码:

git log  --author="songyang" --since="2019-05-01" --until="2019-05-31" --pretty=tformat:  --numstat  -- . ":(exclude)static/built" ":(exclude)static/bower_components" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'  

参数:

author: 作者,

since: 起始时间

until: 结束时间

-- . ":(exclude)folderName" 排除文件夹

-- . ":(exclude)folderName1" ":(exclude)folderName2" 排除多个文件夹

 

示例代码中排除了“static/built”和“static/bower_components”这两个文件夹。执行结果如下:

git log统计个人代码量,排除多个文件夹_第1张图片

 

参考资料:

https://www.cnblogs.com/bellkosmos/p/5923439.html

你可能感兴趣的:(git)