I have some Laravel/Livewire files matching filename patterns like seen in below:
app/Livewire/String1Table.php
app/Livewire/String1s.php
app/Livewire/EditString1.php
app/Models/String2Table.php
app/Models/SubDir/SomeString2.php
resources/views/livewire/string1-table.blade.php
resources/views/livewire/string1s.blade.php
resources/views/livewire/edit-string1.blade.php
Now I want to git add only those files that contain String1 or string1 (apparently disregarding the case) and only those that are within the [L|l]ivewire folder (disregarding the case here too).
I know that git add supports the asterisk and some of regex, but does it support all the bash related pattern matches ? Any ideas on how can I achieve what I want? Hope the requirement is clear.
From the first 2 informative comments, I am wondering if this would be correct: git add *[Ll]ivewire/*String1[?s] ? I am not so well-versed with regex that much, that's why I wanna know if anyone can come up with a way or partial way. I don't wanna end up adding files incorrectly.
You can use
findto locate the desired files:Once you have a
findcommand that matches the desired files, you can rungit addon each file by passing an-execoption: