年中了,看一下你写了多少代码吧

公司里年中总结,有个估计写了多少代码,这个,恩“估计”。
于是查阅了一番,其实可以精确的但是啊,怎么估计你懂得-。-
下面奉上一段git查看代码量的代码

git log --author="$(git config --get user.name)" --since=2016-01-01 --until=2016-07-25 --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 }'

对了,要cd到你的项目里哟。

你可能感兴趣的:(年中了,看一下你写了多少代码吧)