Created
January 14, 2016 09:27
-
-
Save lloiacono/ec8358708ef93adee7fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_prev() { | |
git checkout HEAD~ | |
} | |
# checkout next (newer) commit | |
git_next() { | |
BRANCH=`git show-ref | grep $(git show-ref -s -- HEAD) | sed 's|.*/\(.*\)|\1|' | grep -v HEAD | sort | uniq` | |
HASH=`git rev-parse $BRANCH` | |
PREV=`git rev-list --topo-order HEAD..$HASH | tail -1` | |
git checkout $PREV | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment