git log --author="$(git config --get user.name)" --pretty=tformat: --numstat -- src | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "Added lines: %s Removed lines : %s Total lines: %s ",add,subs,loc }' -git log -1,加上参数-1是统计最近一次提交的