Please see this question, and my comment at the bottom of the question.
I have just cloned a repo in a Windows 10 OS which I developed in Linux, and git won't let me check to a branch because elements in it have paths which are illegal in Windows. To work around this I have checked out the branch concerned in WSL.
But what I want to do is delete all elements matching a pattern in all commits in a given branch (or indeed throughout the entire repo). Is there any way to do that?
This is the error I got in W10 (i.e. before going into WSL):
D:\My documents\doc_indexer>git checkout br_2022_01_16
error: invalid path 'D:\temp\logging/doc_indexer/.__rotator_fh.lock'
error: invalid path 'D:\temp\logging/doc_indexer/rotator_fh.log.1'
These paths are illegal in Windows not least because they contain a ":". These two files are not showing in WSL as part of the commit on the checked out branch ... and are therefore in older commits in this branch.
How might I weed them out and destroy them? If this is very hard or impossible, is there something else I might do so I can check out this branch in W10 "normal"?
Answers to comment questions
git ls-tree -r br_2022_01_16
: yes, those blobs are listed there...
git rev-parse --show-toplevel
: this shows the root directory, i.e. the one containing dir ".git".