fatal: destination path '.' already exists and is not an empty directory.如何 clone git 项目到一个非空目录

来源:互联网 发布:武当七侠java 编辑:程序博客网 时间:2024/05/21 08:53

解决的办法是:

1. 进入非空目录,假设是 /workdir/proj1

2. git clone --no-checkout https://git.oschina.net/NextApp/platform.git tmp

3. mv tmp/.git .   #将 tmp 目录下的 .git 目录移到当前目录

4. rmdir tmp

5. git reset --hard HEAD

然后就可以进行各种正常操作了。

0 0