search

Home  >  Q&A  >  body text

git执行克隆时候失败问题

在使用git克隆服务器上的项目的时候出现错误,不知道怎么解决了。我的执行如下

Admin@Administrator MINGW64 /d/htdocs/workwindow
$ git clone git.............git develop.local/
fatal: destination path 'develop.local' already exists and is not an empty directory.
高洛峰高洛峰2767 days ago648

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-02 09:40:50

    Well, if the specified folder is not empty when gitclone, this error will indeed occur. The solution is as follows

    //首先先进入到你要clone的文件夹下,比如你的是develop.local
    cd develop.local/
    //然后执行git clone指定一个临时到文件即可,如tmp
    git clone git........git tmp
    //然后把你clone好的tmp中的.git文件移动到当前文件
    mv tmp/.git .
    //然后在把你clone到本地的临时文件tmp删除就行啦
    sudo rm -rf tmp
    //最后重置git抹掉所有操作痕迹
    git reset --hard HEAD

    This way you can set up your remote warehousegit和本地这个非空文件关联好啦,可以放心使用git

    reply
    0
  • Cancelreply