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
The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was. If there was a bug in code,use it to identify who cased it,then you can blame him. Git blame is get blame(d).
Blaming only a limited line range Sometimes, You don't need to blame the entire file, you just need to blame in a limited line range. Git blame provides the option for that. -L will take the option for the start line and for the end line. The above command will blame from line 80 through line 100.
The report does not tell you anything about lines which have been deleted or replaced; you need to use a tool such as git diff or the "pickaxe" interface briefly mentioned in the following paragraph.
On GitHub.com, navigate to the main page of the repository. Click to open the file whose line history you want to view. In the upper-right corner of the file view, click Blame to open the blame view.
You can add at the end of the command uniq
to make author unique.
git blame filename --porcelain | grep "^author " | sort -u
sort Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With