如何从git grep搜索中排除某些目录/文件 [英] How to exclude certain directories/files from git grep search

查看:282
本文介绍了如何从git grep搜索中排除某些目录/文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 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 then git grep --exclude-standard.

EDIT see onlynone answer, since git 1.9.0 it's possible.

这篇关于如何从git grep搜索中排除某些目录/文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆