ios自动统计代码行数

来源:互联网 发布:支票管理打印软件 编辑:程序博客网 时间:2024/05/17 22:47

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 }' -

原创粉丝点击