我知道,如果我只想在具有特定扩展名的文件上 grep 查找模式,我可以这样做:
// searches recursively and matches case insensitively in only javascript files
// for "res" from the current directory
grep -iIr --include=*.js res ./
我一直在尝试寻找一种通过 git grep 来执行此操作的方法(以利用 git grep 与树一起存储的索引的速度),但无济于事。我看见here http://git.661346.n2.nabble.com/git-grep-while-excluding-files-in-a-blacklist-td7195648.html排除某些文件类型是不可能的。
是的,例如:
git grep res -- '*.js'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)