为什么我会得到"目的地路径".从我的webfaction服务器尝试克隆时已经存在"错误?

use*_*364 13 git webfaction

我正在尝试使用git clone从我的webfaction服务器下载代码

$ cd ../webapps/nameofwebapp/
$ git clone git@github.com:github-username/github-repo.git ./
Run Code Online (Sandbox Code Playgroud)

并且有错误:

fatal: destination path '.' already exists and is not an empty directory.
Run Code Online (Sandbox Code Playgroud)

我使用ls,并且有一些东西 nameofwebapp

auth  git.cgi  gitweb.cgi  repos  static
Run Code Online (Sandbox Code Playgroud)

我想问一下在哪里使用git clone 我是否需要创建一个新目录?

Von*_*onC 5

只是:

git clone git@github.com:github-username/github-repo.git
Run Code Online (Sandbox Code Playgroud)

这将创建一个新的文件夹github-repo../webapps/nameofwebapp/.

在你的情况下:

cd ../webapps/nameofwebapp/
git clone git@github.com:github-username/github-repo.git -b develop ./
Run Code Online (Sandbox Code Playgroud)

如果您已经完成了克隆:

cd github-repo
git checkout -b develop origin/develop
Run Code Online (Sandbox Code Playgroud)