Git: What’s the best practice to “git clone” into an existing folder?

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”.

git clone https://myrepo.com/git.git temp
mv temp/.git code/.git
rm -rf temp

This can also be done without doing a checkout during the clone command; more information can be found here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)