2025-03-01发表2025-04-04更新操作系统 / Linux / macOS几秒读完 (大约105个字)Git常用统计命令 按照增删代码行数,输出百分比,对贡献者进行排名 git log --all --no-merges --numstat --pretty=format:"%an" | awk ' /^[^0-9-]/ {user=$0} /^[0-9]/ {add[user]+=$1; del[user]+=$2; total+=$1+$2} END { for (u in add) printf "%s: %d/%d = %.2f%%\n", u, add[u]+del[u], total, (add[u]+del[u])*100/total }' | sort -t= -k2 -nr Station Chenqiao: 634940/1677098 = 37.86%liuc: 589876/1677098 = 35.17%tongyuhu: 262416/1677098 = 15.65%zhenwei: 57935/1677098 = 3.45%Shuo Dai: 56632/1677098 = 3.38%niuhao: 49964/1677098 = 2.98%SunYupeng: 17014/1677098 = 1.01%daisy: 4615/1677098 = 0.28%陈桥驿站: 2879/1677098 = 0.17%ohhhhDaisy: 718/1677098 = 0.04%zhenwei688: 106/1677098 = 0.01% <--Administrator: 3/1677098 = 0.00% 项目第一次提交的日期 git log --reverse --format="%ad" --date=short | head -n 1 2020-11-25Git常用统计命令https://cctv3.net/static/20250301/git-calculate-commands.html作者陈桥驿站发布于2025-03-01更新于2025-04-04许可协议#GitSourcetree