Git users: I want to git rm all files in a directory which match the pattern "*.png".
-
Git users: I want to git rm all files in a directory which match the pattern "*.png". git is freaking out because files in the directory contain spaces. What can I do about this?
-
Git users: I want to git rm all files in a directory which match the pattern "*.png". git is freaking out because files in the directory contain spaces. What can I do about this?
I tried:
git rm "*.png"
with spaces around the expression. *Completely inexplicably*, what this did was rm all png files *in subdirectories*, which is not what I told it to do, and not what I wanted, and also did nothing to the files with spaces
-
I tried:
git rm "*.png"
with spaces around the expression. *Completely inexplicably*, what this did was rm all png files *in subdirectories*, which is not what I told it to do, and not what I wanted, and also did nothing to the files with spaces
do i need to look up how to use xargs again
-
ls *.png | perl -ne 'print unless (/fna|white\./)' | xargs -I {} git rm "{}"
fine. whatever. i still hate git
-
ls *.png | perl -ne 'print unless (/fna|white\./)' | xargs -I {} git rm "{}"
fine. whatever. i still hate git
@mcc … what shell is this? that is not how wildcards are supposed to work 😵💫
-
@glyph There is some way for a program such as git to hijack tab completion. Is there a way for a program such as git to negotiate with the shell to get wildcards passed through verbatim instead of expanded?
-
@glyph There is some way for a program such as git to hijack tab completion. Is there a way for a program such as git to negotiate with the shell to get wildcards passed through verbatim instead of expanded?
@glyph also it's bash on windows services for linux 1. i would place a very very low but nonzero bayesian probability on the chance that something about how NTFS interacts with WSL1 is fucking us up here.
-
@glyph also it's bash on windows services for linux 1. i would place a very very low but nonzero bayesian probability on the chance that something about how NTFS interacts with WSL1 is fucking us up here.
@mcc okay this is all a red herring. nothing to do with spaces at all, globbing is working fine, the glob just caught (and you were thus trying to rm) an untracked file:
-
undefined Oblomov shared this topic on