Skip to content

Instantly share code, notes, and snippets.

@chrisyeung1121
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisyeung1121/1a3efcb1914dfdf3cf4f to your computer and use it in GitHub Desktop.
Save chrisyeung1121/1a3efcb1914dfdf3cf4f to your computer and use it in GitHub Desktop.
Git command to print the SHA1 of the nth commit
# 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