Why am I getting a "destination path '.' already exists" error when trying clone from my webfaction server?

user2492364 picture user2492364 · Aug 31, 2014 · Viewed 53.2k times · Source

I'm trying to use git clone to download the codes from my webfaction server

$ cd ../webapps/nameofwebapp/
$ git clone [email protected]:github-username/github-repo.git ./

AND there is error :

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

I use ls and there are something under the nameofwebapp

auth  git.cgi  gitweb.cgi  repos  static

I want to ask where to use git clone Do I need to make a new directory??

Answer

VonC picture VonC · Aug 31, 2014

Simply:

git clone [email protected]:github-username/github-repo.git

That will create a new folder github-repo in ../webapps/nameofwebapp/.

In your case:

cd ../webapps/nameofwebapp/
git clone [email protected]:github-username/github-repo.git -b develop ./

If you already did the clone:

cd github-repo
git checkout -b develop origin/develop