How to get the list of all users who contributed for this one file ?
Asked
Active
Viewed 220 times
1 Answers
2
You can find most of this by reading the online help for git log
(and the deduplication step is basic shell knowledge, assuming you have something like a reasonable shell).
get the list of all commits affecting the file:
git log -- filename
format the commits so only the author is printed:
git log --pretty=format:%an -- filename
make sure effective no-op commits are not pruned, if that matters:
git log --pretty=format:%an --full-history -- filename
deduplicate
git log --pretty=format:%an --full-history -- filename | sort -u

Useless
- 64,155
- 6
- 88
- 132
-
1You might also want to throw `--all` in to cover for other branches than the currently checked out one. But not necessarily, as it depends on your workflow. – Romain Valeri Oct 22 '21 at 13:15