Git path to any directory name

In git we can use *to specify a file name, for example *.jpg, *.*but what about the catalogs?

Is there any method to specify the whole directory?

This does not work:

git rm firstdirectory/*/thirddirectory

* does not perform the effect of "all directories".

+5
source share
2 answers

Your command does not work because you are specifying a git directory. Your shell does the correct extension, but at the end git gets git rm firstdirectory/somedir/thirddirectorywhich git doesn't like ( git rmexpects files)

For your team to work, use the flag -r, then git accepts the directory:

git rm -r firstdirectory/*/thirddirectory
+3
source

glob, , git, . , - echo *. , , .

find . -ipath, , , . , -type d, . find . xargs git. :

find firstdirectory -ipath 'firstdirectory/*/thirddirectory' | xargs git rm
0

All Articles