In git we can use *
to specify files name, like *.jpg
, *.*
, but how about directories?
Is there any method to specify all directory?
This doesn't work:
git rm firstdirectory/*/thirddirectory
The *
doesn't do the "all directories" effect.
Your command doesn't work because you're specifying a directory to git. Your shell does the correct expansion, but in the end git receives git rm firstdirectory/somedir/thirddirectory
, which git doesn't like (git rm
expects files)
To make your command work, use the -r
flag, then git accepts directory:
git rm -r firstdirectory/*/thirddirectory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With