stackyyflow
stackyyflow

Reputation: 763

Git blame a list of authors in a file

Is there a way to find out a list of authors who edited the class in java file in repo using git blame? The list of authors have to be unique.

I have tried using the following command but it did not remove duplicates and there is word "author" in every line of output. There is no need to sort the output, but I hope to get output without any duplicates.

git blame filename --porcelain | grep  "^author "

Expected output should be just author name: John Michael

Upvotes: 11

Views: 9381

Answers (1)

Flows
Flows

Reputation: 3863

You can add at the end of the command uniq to make author unique.

git blame filename --porcelain | grep  "^author " | sort -u

sort Documentation

Upvotes: 15

Related Questions