Created
September 28, 2017 03:34
-
-
Save cmattoon/75f9a974e696ce9238d28430e2422981 to your computer and use it in GitHub Desktop.
git-prev-next
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
#!/bin/bash | |
# Provides 'git-prev' and 'git-next' commands for git | |
# to facilitate browsing step-by-step | |
# Run "source git_move.sh" to activate commands | |
_git_next() { | |
git log --reverse --pretty=%H master | \ | |
grep -A 1 $(git rev-parse HEAD) | \ | |
tail -n1 | xargs git checkout | |
} | |
alias git-prev="git checkout HEAD^1" | |
alias git-next="_git_next" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment