Skip to main content

Coding

Tiu MoLess than 1 minute

nihaonihao

好用的代码库

ViTopen in new window

统计代码数量

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$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 }' -; done

统计提交次数

git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r

查看个人提交

git log --author="username" --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 }' -