How to clone a GIT repository into a non-empty directory.

If you need to clone a GIT repository into an existing directory with files, use the following commands in command prompt in order.

 

git init
git init add origin PATH/TO/REPO
git fetch
git reset origin/master
git checkout -t origin/master

After this, you can easily use your favorite GUI tool like TortoiseGIT or command line to sync files.

Leave a Comment