Reputation: 2328
In other words, what git log --follow <file>
does, but for all authors together.
For example, if "contributor1" commits to a file 5 times, and I do it 3, the result should be 8 for that file.
Upvotes: 0
Views: 104
Reputation: 4452
You can find the total number of commits to a given file, even through renames, by combining git log
with wc
:
git log --follow --oneline -- filename | wc -l
Upvotes: 1
Reputation: 601471
One option to get the number of commits for each file would be
git log --format=format: --name-only | sort | uniq -c
This lists the files that were changed in each commit, then groups by file name and counts the occurrences.
If you just want to know the number of commits for a single file, you can use
git rev-list --count HEAD -- <filename>
Upvotes: 1