Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File Expansion in .gitattributes

Tags:

git

.gitattributes allows running filters for several extensions like:

*.sh filter=myFunc
*.txt filter=myFunc

I thought (or better hoped) I can "oneline" this with file expansion:

*.{sh,txt} filter=myFunc

Unfortunately while the former works the later does not. Is there a way to match several extensions in one shot?

like image 852
Anatol Avatar asked Nov 17 '25 23:11

Anatol


1 Answers

The short answer is no. Git's glob patterns do not include brace expansion. See the gitglossary entry for pathspec for what is allowed (and note that not all commands use pathspecs, some just use raw globs).

like image 92
torek Avatar answered Nov 20 '25 13:11

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!