Created
November 6, 2015 20:27
-
-
Save avanslaars/5726fb8835a5a564ddf5 to your computer and use it in GitHub Desktop.
Bash functions for stepping forward and backward through git commits.
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_next() { | |
BRANCH=$1 | |
git checkout `git log --reverse --ancestry-path HEAD..${BRANCH:="master"} | head -n 1 | cut -d \ -f 2` | |
} | |
git_prev(){ | |
git checkout HEAD^ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment