0

How to get the list of all users who contributed for this one file ?

Mayank_MP5
  • 153
  • 1
  • 8

1 Answers1

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).

  1. get the list of all commits affecting the file:

    git log -- filename

  2. format the commits so only the author is printed:

    git log --pretty=format:%an -- filename

  3. make sure effective no-op commits are not pruned, if that matters:

    git log --pretty=format:%an --full-history -- filename

  4. deduplicate

    git log --pretty=format:%an --full-history -- filename | sort -u

Useless
  • 64,155
  • 6
  • 88
  • 132
  • 1
    You 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