Created
November 17, 2015 14:46
-
-
Save maximkott/12a8165d8b70fb95cd50 to your computer and use it in GitHub Desktop.
Moving back and forth between 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
function n() { | |
git log --reverse --pretty=%H master | grep -A 1 $(git rev-parse HEAD) | tail -n1 | xargs git checkout | |
} | |
function p() { | |
git checkout HEAD^1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment