以下內(nèi)容來(lái)源網(wǎng)絡(luò)搜集:
- 列出貢獻(xiàn)者名單:
git log --format='%aN' | sort -u - 列出給定用戶修改的文件數(shù)、增加的行數(shù)、刪除的行數(shù):
或:git log --shortstat --author="xxx" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed: ", files, "lines inserted: ", inserted, "lines deleted: ", deleted }'git log --author="xxx" --pretty=tformat: --numstat | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' - - 給出提交統(tǒng)計(jì)列表:
git shortlog -sn - 列出倉(cāng)庫(kù)提交前5名:
git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5 - 統(tǒng)計(jì)時(shí)間區(qū)間內(nèi)給定用戶新增和刪除的行數(shù):
git log --pretty=tformat: --numstat --since=".$since." --until=".$until." --author=".$author | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -