Git log * .java files and commiters

How can I get a list of all Java files in my repo and get the original author and each committer to this file since then.

My attempt is lower, but after that I will need one line for each Java file and a list of all commiters.

git log --name-only --pretty=format:"The author of %h was %ae on %aD" -- '*.java' 
+4
source share
1 answer

I don’t think that you are far away, but I also don’t think that it can be obtained directly using GIT, instead list all the monitored files first and then iterate over them each.

 for file in $(git ls-files | grep \.java$) do echo "Looking at $file"; git log --pretty=format:"The author of commit %h was %ae on %aD" -- $file; echo; done 

Note. Using git ls-files *.java will only display monitored java files in the current directory, and not all java files in the repo.

+1
source

All Articles