Created
December 16, 2013 14:46
-
-
Save quimic-gist/7988125 to your computer and use it in GitHub Desktop.
Git:Clone repo into non empty directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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