我在Github上和一些合作者一起做一个项目,我们想知道每个人做了多少工作,比如创建代码的百分比,或者计算每一行代码的数量,以找出谁做了什么?有什么办法吗?
30byixjq1#
在您的项目中,转到Insights选项卡,然后单击Contributors。以下是npm项目中的一个示例:https://github.com/npm/npm/graphs/contributors你可以看到在你想要的任何时间段内提交、添加和删除的数量。
Insights
Contributors
npm
xlpyo6sf2#
您可以在存储库中使用此命令:
git log --format='%aN' | Sort-Object -Unique | ForEach-Object { $name = $_ $addedLines = 0 $removedLines = 0 (git log --author="$name" --pretty=tformat: --numstat) | ForEach-Object { if ($_ -match '(\d+)\s+(\d+)') { $addedLines += [int]$matches[1] $removedLines += [int]$matches[2] } } [PSCustomObject]@{ Author = $name AddedLines = $addedLines RemovedLines = $removedLines TotalLines = $addedLines - $removedLines }} | Format-Table -AutoSize
git log --format='%aN' | Sort-Object -Unique | ForEach-Object {
$name = $_
$addedLines = 0
$removedLines = 0
(git log --author="$name" --pretty=tformat: --numstat) | ForEach-Object {
if ($_ -match '(\d+)\s+(\d+)') {
$addedLines += [int]$matches[1]
$removedLines += [int]$matches[2]
}
[PSCustomObject]@{
Author = $name
AddedLines = $addedLines
RemovedLines = $removedLines
TotalLines = $addedLines - $removedLines
} | Format-Table -AutoSize
2条答案
按热度按时间30byixjq1#
在您的项目中,转到
Insights
选项卡,然后单击Contributors
。以下是
npm
项目中的一个示例:https://github.com/npm/npm/graphs/contributors你可以看到在你想要的任何时间段内提交、添加和删除的数量。
xlpyo6sf2#
您可以在存储库中使用此命令: