How to git grep only a set of file extentions -


how perform git grep , limit files checked set of files. able grep contents of .cpp , .h files looking myfunc. eg:

git grep "myfunc" -- *.[hc]* 

however matches, .c files , .cs files.

use:

git grep "myfunc" -- '*.cpp' '*.h' 

the quotes necessary git expands wildcards rather shell. if omit them, it'll search files in current directory, rather including subdirectories.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -