Search code examples
gitgit-clone

How to get Git to clone into current directory


I'm doing:

git clone ssh://[email protected]/home/user/private/repos/project_hub.git ./

I'm getting:

Fatal: destination path '.' already exists and is not an empty directory.

I know path . already exists. And I can assure that directory IS empty. (I do ls inside and I see nothing!)

What am I missing here in order to clone that project into the current directory ?


Solution

  • The solution was using the dot, so:

    rm -rf .* && git clone ssh://[email protected]/home/user/private/repos/project_hub.git .`
    

    rm -rf .* && may be omitted if we are absolutely sure that the directory is empty.

    Credits go to: @James McLaughlin on comments