I need add into the staged area all ini files of current directory and its subdirectories recursively. Is exist a single filter for it?
I use it:
git add *.ini ./**/\*.ini
So I pointed two selection rules. Can I write it more compactly through a single rule?
I tried such variants: **/\*.ini, ./**/\*.ini, */**/\*.ini but these are not the same.
Use git add "*.ini". By putting *.ini in quotes you avoid that your shell is expanding the pattern to only the matching file(s) in your current directory before even passing the argument to git.
In general, you can use find for more complicated operations:
find . -type f -name '*.ini' -exec git add {} +
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