如何从git grep搜索中排除某些目录/文件 [英] How to exclude certain directories/files from git grep search
问题描述
有没有办法使用 git grep
来搜索git存储库,但排除搜索中的某些路径/目录/文件?像普通grep命令中的 - 排除
选项一样。
如果您很好奇:我不想使用普通的grep,因为它比 git grep
当git仓库的大小很大时。
这是不可能的,但最近已经讨论过了。链接中的建议解决方法:
您可以将
*。dll
放入.gitignore文件然后git grep --exclude-standard
。
编辑看到唯一的答案,因为git 1.9.0是可能的。
Is there a way to search git repository using git grep
but exclude certain paths/directories/files from the search? Like the --exclude
option in normal grep command.
If you are curious: I don't want to use normal grep since it is much slower than git grep
when the size of the git repository is large.
It's not possible, but has been discussed recently. Proposed workaround in link:
You can put
*.dll
to .gitignore file thengit grep --exclude-standard
.
EDIT see onlynone answer, since git 1.9.0 it's possible.
这篇关于如何从git grep搜索中排除某些目录/文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!