user3313834
user3313834

Reputation: 7827

filter a `git grep` search on more than one pattern

to filter a git grep search on one file pattern I use this::

$ git grep xyz -- '*.py'

How can I search on more than one pattern ?

This did not work:

 $ git grep xyz -- '*.{py,yml}'

Upvotes: 1

Views: 82

Answers (1)

VonC
VonC

Reputation: 1323593

I just tested:

git grep xyz -- *.py *.yml

That bash expansion does the right thing and git grep applies to the expected set of files.

Upvotes: 1

Related Questions