gpt4 book ai didi

GIT - 谁 push/编写了最多的代码

转载 作者:太空狗 更新时间:2023-10-29 12:50:28 24 4
gpt4 key购买 nike

是否有一个 git 命令可以检查哪个开发人员推送了所有历史记录最多的代码?

最佳答案

我发现了一些东西,

git ls-files | xargs -n1 -d'\n' -i git-blame {} | perl -n -e '/\s\((.*?)\s[0-9]{4}/ && print "$1\n"' | sort -f | uniq -c -w3 | sort -r
User: askedrelic
Functions: perl sort uniq xargs

Prints per-line contribution per author for a GIT repository

Figures out total line contribution per author for an entire GIT repo. Includes binary files, which kind of mess up the true count.

If crashes or takes too long, mess with the ls-file option at the start:

git ls-files -x "*pdf" -x "*psd" -x "*tif" to remove really random binary files

git ls-files "*.py" "*.html" "*.css" to only include specific file types

Based off my original SVN version: http://www.commandlinefu.com/commands/view/2787/prints-total-line-count-contribution-per-user-for-an-svn-repository

http://www.commandlinefu.com/commands/view/3889/prints-per-line-contribution-per-author-for-a-git-repository

关于GIT - 谁 push/编写了最多的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5073148/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com