List commits between 2 commit hashes in git November 7, 2022 by Tarik I think that you`re looking for –ancestry-path, in your case: git rev-list --ancestry-path 7b4a07a..ecf5891