使用方法
在項(xiàng)目的文件夾中,右鍵,選擇Git Bash Here
會(huì)彈出命令行框文章來源:http://www.zghlxwxcb.cn/news/detail-514895.html
使用下面的代碼去統(tǒng)計(jì)文章來源地址http://www.zghlxwxcb.cn/news/detail-514895.html
統(tǒng)計(jì)指定用戶的提交代碼行數(shù)
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 }' -
統(tǒng)計(jì)所有貢獻(xiàn)者提交代碼行數(shù)
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
統(tǒng)計(jì)所有貢獻(xiàn)者的提交次數(shù)
git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r
統(tǒng)計(jì)指定時(shí)間內(nèi)某貢獻(xiàn)者的提交行數(shù)
git log --author="xxx" --since='2023-06-18 00:00:00' --until='2023-08-15 23:00:00' --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 }' ```
到了這里,關(guān)于統(tǒng)計(jì)Git項(xiàng)目各成員貢獻(xiàn)量(代碼行數(shù)、提交次數(shù))的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!