Git clone leads to deleted & untracked files

pHneutre picture pHneutre · Aug 16, 2016 · Viewed 9.5k times · Source

I am new to Git.

I just installed Git (2.9.3) for Windows (10), then I opened git-bash and did a git clone <remoteURL>. A new folder is created with the whole copy of the remote repository, which is good. But then I run a git status and I get a ton of deleted files (I suppose all the files that just got copied) ready to be committed, and the three main folders under the repository folder are untracked. The deleted files actually exist on my drive though!

I am pretty sure my git status should be clean instead. What is happening?

This about deleted files didn't help (I didn't use checkout), neither did this about untracked files (I'm not using Mac OS).

Answer

pHneutre picture pHneutre · Aug 17, 2016

I was retrieving a huge project with very long paths. I forgot to set up Git to use long paths:

git config --global core.longpaths true

After this, the cloning went fine and the status clean.