Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get authors of changes between 2 commits?

Tags:

git

author

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

What would be the best for me is something like:

git diff --name-only master

but instead of

--name-only 

parameter like

--authors-only

But unfortunately diff does not have such one. There is no restriction I have to use diff command, git log or others are also fine.

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

like image 391
Michał Avatar asked Apr 13 '17 06:04

Michał


2 Answers

you can use something like

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

where the format will print the author name and email and than the commits see List commits between 2 commit hashes in git

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

like image 44
Srgrn Avatar answered Oct 19 '22 18:10

Srgrn


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

like image 127
DAle Avatar answered Oct 19 '22 17:10

DAle