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.
Written by Wojtek Ryrych
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#