Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

webfaction

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??

like image 258
user2492364 Avatar asked Aug 31 '14 11:08

user2492364


People also ask

Why is git clone not copying source files to my local directory?

You might discover that the source files were there before, but were removed in a subsequent commit. If so, just git checkout to an older commit. Also possible that there's simply no files in the master branch ( git log --all will show other branches). See git branch for list and git checkout another branch.

How do I change to the local directory where I want to clone my repository?

Go to the current directory where you want the cloned directory to be added. To do this, input cd and add your folder location. You can add the folder location by dragging the folder to Git bash. Click on “Clone or download” and copy the URL.

How do I clone a path?

Find the file or folder whose path you'd like to copy in File Explorer. Hold down Shift on your keyboard and right-click on it. In the context menu that pops up, select “Copy As Path.”

How do I clone a git repository to a specific folder?

To clone git repository into a specific folder, you can use -C <path> parameter, e.g. Although it'll still create a whatever folder on top of it, so to clone the content of the repository into current directory, use the following syntax: cd /httpdocs git clone [email protected]:whatever .


1 Answers

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
like image 171
VonC Avatar answered Sep 23 '22 09:09

VonC