Clone only the .git directory of a git repo

The one-step solution would be:

git clone --no-checkout <repo_url>

or if you already have an empty dir for it,

cd myrepo
git clone --no-checkout <repo_url> .

Leave a Comment