0

When I try to clone the code in git I'm facing this issue:

Cloning into 'velammal_cms'...
Receiving objects: 100% (8846/8846), 96.86 MiB | 1.75 MiB/s, done.
Resolving deltas: 100% (2228/2228), done.
error: invalid path 'public/LSPDF/NewGen/3/English/Book-1:-What-Strange-Creatures!.pdf'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Saeed
  • 3,294
  • 5
  • 35
  • 52
Jayanthi
  • 25
  • 7

1 Answers1

0

I assume you are in a windows machine, Because of the issues in the filename that might cause issues in windows NTFS file system git prevents it by default

core.protectNTFS If set to true, do not allow checkout of paths that would cause problems with the NTFS filesystem, e.g. conflict with 8.3 "short" names. Defaults to true on Windows, and false elsewhere.

ref : https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreprotectNTFS

As a workaround Run git config --global core.protectNTFS false

Then try to clone

Or since its already cloned but not checked out, you may set this setting local to this repository only

Run git config core.protectNTFS false Then Run git checkout <branch_name>

Jebil
  • 1,144
  • 13
  • 25
  • Thanks for the guidence. Working now I can check out the branch but still some files are showing as deleted Cloning into 'velammal_cms'... Receiving objects: 100% (8846/8846), 96.86 MiB | 838.00 KiB/s, done. Resolving deltas: 100% (2228/2228), done. error: invalid path 'public/LSPDF/NewGen/3/English/Book-1:-What-Strange-Creatures!.pdf' fatal: unable to checkout working tree warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/' @jebil – Jayanthi Nov 24 '21 at 06:03
  • did you set the config as local or global ? if set local, we should not try to clone again, just checkout only. If set as global. we may try a fresh clone – Jebil Nov 24 '21 at 06:06
  • No I did no do any changes in any file just from master i have checked out to dev branch and cloned again the dev branch @jebil – Jayanthi Nov 24 '21 at 06:22