Skip to content

Instantly share code, notes, and snippets.

@rca
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rca/db862e857ba39e7d169b to your computer and use it in GitHub Desktop.
Save rca/db862e857ba39e7d169b to your computer and use it in GitHub Desktop.
Step through commits in a git branch
#!/bin/bash
# step through commits showing the commit information
BASE_REV=${BASE_REV:-$1};
current_branch=$(git branch | grep '^*' | awk '{print $2}');
for rev in $(git rev-list ${BASE_REV}..HEAD | tail -r); do
git checkout $rev;
LESS='CRSX' git show -p $rev;
done;
git checkout ${current_branch};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment