git fails when executing clone
高洛峰
高洛峰 2017-05-02 09:38:50
0
1
661

An error occurred when using git to clone the project on the server. I don’t know how to solve it. My execution is as follows

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.
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
PHPzhong

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template