Skip to content

Instantly share code, notes, and snippets.

@adrianwebb
Last active August 29, 2015 13:58
Show Gist options
  • Save adrianwebb/10426167 to your computer and use it in GitHub Desktop.
Save adrianwebb/10426167 to your computer and use it in GitHub Desktop.
Git existing repo initialization
# Source: http://stackoverflow.com/questions/5377960/whats-the-best-practice-to-git-clone-into-an-existing-folder
git init
git remote add origin $repo_url
git fetch origin
git checkout -b $branch --track origin/$branch
git reset origin/$branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment