How to clone git project to a non-empty directory

If we clone the Git  project to a non-empty directory  , an error message will be prompted:

fatal: destination path '.' already exists and is not an empty directory.

The solution is:

1. Enter a non-empty directory, assuming /workdir/proj1

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

3. mv tmp/.git . #Move the .git directory in the tmp directory to the current directory

4. rmdir tmp

5. git reset --hard HEAD

Then you can perform various normal operations.

 

 

Reprinted from: http://www.oschina .Net /question/54100_167919?sort=time

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326206676&siteId=291194637