Last Updated: June 24, 2016
·
186
· ryrych

Reviewing git changes with git show head~{commits-not-in-master}

Suppose that you’re going to push commits. It’s a good rule of thumb to review them before the git push. As CLI is your friend, with:

git le head --not origin/master | wc -l

You know exactly how many commits there are in your local branch. Now with git show head~42 you can review each commit step by step:

  • git show head~41
  • git show head~40
  • and so on

I tend to split the terminal window horizontally and keep the list of commits at the top while running git show head~40 at the bottom.