Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Check out the nth commit to master in a git repository. This command can be used during presentation to skip through the history of a repo.
#!/bin/bash
git checkout master
SHA1=`git rev-list HEAD | tail -n $1 | head -n 1`
git checkout $SHA1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment