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
Post a Comment