Created
September 23, 2013 21:12
-
-
Save jamiehs/6677047 to your computer and use it in GitHub Desktop.
Here's a little trick for cloning into an existing directory. The long and short of it is that you're checking the project out into a temp folder, then moving the git directory, and then resetting to the head.
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
# From: http://stackoverflow.com/a/2484349/24559 | |
git clone --no-checkout repo-to-clone existing-dir/existing-dir.tmp | |
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