Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active August 29, 2015 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasdev/1d2c9cbb9883fb512d07 to your computer and use it in GitHub Desktop.
Save jasdev/1d2c9cbb9883fb512d07 to your computer and use it in GitHub Desktop.
Clone repo at specific commit
clonerev() {
git clone $1
cd 'sed ${1}##/*/ s/.git//'
git reset --hard $2
}
# Usage: clonerev [url] [commit hash]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment