All BUNCH files were checked in our git repository before we submitted the .gitignore file. I am currently trying to clear it:
git rm --cached `git ls-files -i --exclude-from=.gitignore`
MANY file paths have spaces.
For instance:
...... Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg12.png.meta Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg13.png.meta Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg14.png.meta Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg15.png.meta Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg16.png.meta Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg17.png.meta Assets/Aoi Character Pack/Viewer/Resources/Aoi/Viewer BackGrounds/bg18.png.meta .......
There ALL ALL LOTTA SPACES in general Lotta files that I need to get rid of.
I am looking for an elegant way:
A: Avoid spaces with "\", for example
Assets/Aoi\ Character Pack/Viewer/Resources/Aoi/Viewer\ BackGrounds/bg18.png.meta
-or -
-Edit -
So far I have tried git ls-files -i --exclude-from=.gitignore | sed 's/\ /\\\ /g' git ls-files -i --exclude-from=.gitignore | sed 's/\ /\\\ /g'
While it happily outputs file paths that look the way I expected, with spaces running through ..... When I try to execute
git rm --cached `git ls-files -i --exclude-from=.gitignore | sed 's/\ /\\\ /g'`
I get - error: unknown switch `\ '
Where I expect something elusive to happen to the pipe.
source share