Reputation: 1053
Git log -2 {hash} will limit the output to 2 commits after the provided hash. Is there a way to see the 2 commits that came before the has as well?
Upvotes: 1
Views: 72
Reputation: 5773
I use
git log --pretty=oneline --reverse --ancestory-path {sha}^..master | head -n
where n
is the number of commits you want.
Upvotes: 1