Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git clone displaying errors and marking files as deleted in Windows 10

I am getting the following error when trying to clone a repository with git:

Fatal: Unable to checkout working tree
warning: Clone succeeded, but failed checkout.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

Additionally, the following message appears in several files: 'error: Unable to create file'

https://i.sstatic.net/QIBr3.png

By using the 'git status' command, I see that many files were marked as deleted [actually the files still exist]

https://i.sstatic.net/RX36z.png

I used the git checkout -f HEAD command as was requested in the first mistake, but the result was the following

https://i.sstatic.net/PO8Rf.png


1 Answers

Your files has special characters which are not allowed under windows. This is why you cannot checkout the file names.

The only way to fix it is to clone the repository on non windows machine and to rename them.

The following characters are forbidden in file names (Win)

The following reserved characters:

< (less than)  
> (greater than)  
: (colon)  
" (double quote)  
/ (forward slash)  
\ (backslash)  
| (vertical bar or pipe)  
? (question mark)  
&#42; (asterisk)  
like image 154
CodeWizard Avatar answered Sep 17 '25 09:09

CodeWizard