git grep是否可以用于制表符? [英] Is it possible to git grep for tabs?

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

问题描述

这个问题指定 -P 允许GNU grep为选项卡grep

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

grep -P '\t' config/file.txt

然而,使用 git grep ,我可以' t找出如何grep一个标签:

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

git grep '\t' # Looks for files with the letter "t" instead
git grep -P '\t' # Invalid option
git grep -E '\t' # 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天全站免登陆