When I'm trying to checkout to another branch from cmd:
git checkout Datascience_With_Python --
this error is occuring:
error: invalid path 'Datascience_With_Python/Machine Learning/Tutorials/Steps for Machine Learning "MLOps"/README.md'
error: invalid path 'Datascience_With_Python/Machine Learning/Tutorials/Steps for Machine Learning "MLOps"/Steps_For_Machine_Learning_MLOps.ipynb'
I think this is because of the inverted commas in the folder name 'Steps for Machine Learnin "MLOps"' But I can't edit it because it is an open-source project and I am only allowed to work on a particular folder in a particular branch.
I tried:
git clone --sparse -c core.protectNTFS=false -n <repo-URL>
git checkout <branch>
but its deleting all the folders from my local clone of the repo.
I also tried :
git config core.protectNFTS false
git config core.sparsecheckout true
But it also didn't work.
Please help...
The issue also includes the use of double-quotes in
"MLOps"
, and part of the list of characters an OS like Windows would not support in file names.Following "Fixing Invalid Git Paths on Windows" from Brendan Forster, you could:
With
-f
:In your case, that should give you a detached HEAD, with the problematic path "deleted".
Create a fix branch from there, work and commit.
But you won't be able to restore
Steps_For_Machine_Learning_MLOps.ipynb
without fixing its parent folder name.So you can try and push that fix branch, with a warning for other users when they will merge it, as they need to restore the missing file (hopefully not on Windows, since they wouldn't be able to clone it in the first place).
The only permanent solution is to fix the filename, which is what the OP rica-programmer confirms in the comments: