stackyyflow stackyyflow - 1 year ago 102
Git Question

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

Answer Source

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

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

uniq Documentation

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download