Skip to content

Instantly share code, notes, and snippets.

@quimic-gist
Created December 16, 2013 14:46
Show Gist options
  • Save quimic-gist/7988125 to your computer and use it in GitHub Desktop.
Save quimic-gist/7988125 to your computer and use it in GitHub Desktop.
Git:Clone repo into non empty directory
git clone --no-checkout repo-to-clone existing-dir/existing-dir.tmp # might want --no-hardlinks for cloning local repo
mv existing-dir/existing-dir.tmp/.git existing-dir/
rmdir existing-dir/existing-dir.tmp
cd existing-dir
git reset --hard HEAD # git thinks all files are deleted, this reverses that behaviour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment