Skip to content

Instantly share code, notes, and snippets.

@dcparker
Created May 1, 2009 15:44
Show Gist options
  • Save dcparker/105099 to your computer and use it in GitHub Desktop.
Save dcparker/105099 to your computer and use it in GitHub Desktop.
Clone a git repo, checking out a specific branch.
# First, mkdir name & chdir name
git init
git remote add -t $2 origin $1
git fetch
git checkout --track -b $2 origin/$2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment