我正试图使用git clone
从我的网络服务器下载代码
$ cd ../webapps/nameofwebapp/
$ git clone git@github.com:github-username/github-repo.git ./
并且出现错误:
fatal: destination path '.' already exists and is not an empty directory.
我使用ls,在nameofwebapp
下有一些东西
auth git.cgi gitweb.cgi repos static
我想问在哪里使用git clone
我需要制作一个新目录吗??
简单地说:
git clone git@github.com:github-username/github-repo.git
这将在../webapps/nameofwebapp/
中创建一个新的文件夹github-repo
。
在您的情况下:
cd ../webapps/nameofwebapp/
git clone git@github.com:github-username/github-repo.git -b develop ./
如果您已经进行了克隆:
cd github-repo
git checkout -b develop origin/develop
也许您在当前路径中有一个相同名称的git项目目录,git clone命令将创建一个新目录,如果有相同名称的目录,则会崩溃。
对我来说,这个问题与SSH密钥有关。当我设置钥匙时,它工作得很好。