Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

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 you that the 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?

1 Answer

0 votes
by (50.2k points)

For this case the solution is, simply add dot next to it:

git clone [email protected]:user/my-project.git .

Even then the error doesn’t resolve to make sure that the directory is empty if you are not sure about your directory then run the above command with: 

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

This will remove the files present in the directory and then it works.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...