Git常用命令集合

查看个人代码变更量

username需要修改成自己的用户名

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

查看团队代码变更量

awk里面的内容限制了单次commit行数超过2000的不进行统计

--since 开始时间

--until 结束时间

git log  --format='%aE' | sort -u | while read name; do echo -en "$name,\t"; git log --author="$name" --pretty=tformat:  --since="2021-05-01 00:00:00" --until="2021-05-31 23:59:59" --shortstat  | awk '{ add += (int($4)>int('2000')?0:$4); subs += (int($6)>int('2000')?0:$6); loc += $4 - $6 } END { printf "%d, %d\n",  add,subs }' -; done
Copyright © cnkj.site 2021 all right reserved,powered by Gitbook该文件修订时间: 2021-05-28 11:32:19

results matching ""

    No results matching ""