是否可以为选项卡使用 git grep? [英] Is it possible to git grep for tabs?

查看:16
本文介绍了是否可以为选项卡使用 git grep?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题指定-P允许GNUgrep 到 grep 一个标签

This question specifies that -P allows GNU grep to grep for a tab

grep -P '	' config/file.txt

但是,使用 git grep,我无法弄清楚如何为选项卡 grep:

However, using git grep, I can't work out how to grep for a tab:

git grep '	' # Looks for files with the letter "t" instead
git grep -P '	' # Invalid option
git grep -E '	' # Does the same as without the -E

而且似乎没有替代您自己的 grep 程序的选项.是我唯一的选择是将整个内容吸食,然后在结果上使用 GNU grep 吗?

And there doesn't seem to be an option for substituting in your own grep program. Is my only option to slurp the entire contents and then use GNU grep on the results?

推荐答案

您可以通过在命令中键入文字选项卡来解决此问题:

You can work around this by typing a literal tab into your command:

# type it with ^V then tab
git grep '  '

这篇关于是否可以为选项卡使用 git grep?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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