How to get authors of changes between two commits?

I am trying to get authors of changes between two commits.

What would be best for me:

git diff --name-only master 

but instead

 --name-only 

eg

 --authors-only 

But, unfortunately, diff does not have this. There are no restrictions, I have to use the diff , git log or others are fine too.

I need to blame the people who caused the tests to fail.

+7
git author
source share
3 answers

git log --pretty=format:"%an" prevTestCommit..lastTestCommit | sort | uniq

+4
source share

you can use something like

 git log --pretty=format:"%an %aE" f398e997ea9ad81e586b1f751693cd336963ba6a ^bb69eb11d979437a0b390ac9333342e7594c211c 

where the format will print the authorโ€™s name and email address and see list commits between two commit hashes in git

for more information on how to use, get commits between two given commits.

+3
source share

Not sure if this exists by default, but you can specify a custom output format for git log :

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

This will print only the names of the authors. See the PRETTY FORMATS in git log --help for more information.

0
source share

All Articles