Last active
August 29, 2015 14:17
-
-
Save chrisyeung1121/1a3efcb1914dfdf3cf4f to your computer and use it in GitHub Desktop.
Git command to print the SHA1 of the nth commit
This file contains 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
# where 6 = showing the sixth commit. | |
git rev-list --all | tail -n 6 | head -n 1 | |
# $> b753a30804cc0770b52686166a21cbdea642ff08 | |
# Knowing the output, we can then do the following to checkout to that certain commit | |
git checkout b753 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment