您的位置:首页 > 移动开发 > IOS开发

ios自动统计代码行数

2017-11-29 10:03 267 查看
1.先在终端红中下载gawk

brew install gawk

2.然后cd 到项目所在位置:

将以下邮箱地址改成自己在git上的邮箱地址即可

统计30天的代码数:

git log --since=30.day.ago --author="$(git config --get user.name
邮箱地址)" --pretty=tformat: --numstat | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -

统计7天的代码数:

git log --since=7.day.ago --author="$(git config --get user.name
邮箱地址)" --pretty=tformat: --numstat | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: