This can be done by cloning to a new directory, then moving the .git
directory into your existing directory.
If your existing directory is named "code".
1 2 3 |
git clone https://myrepo.com/git.git temp mv temp/.git code/.git rm -rf temp |