統計行數:
git log --author="$(git config --get user.name)" --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 }' -
統計提交(前10個):
git log --since=2016–05-20 --until=2017-05-20 --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 10
git log --since=2015–10-10 --until=2017-05-20 --oneline | wc -l
--since
表示起始時間, --until
表示結束時間。