2010-11-23 78 views
32

This question指定-P允许GNU的grep到grep的标签是否有可能git grep的标签?

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

然而,使用git grep,我不知道如何到grep一个标签:

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 

还有没有按” t似乎是替代您自己的grep程序的一种选择。我唯一的选择是啜食整个内容,然后对结果使用GNU grep?

+0

我不知道`git grep'\\ t'`是否可以工作。 – MatrixFrog 2010-11-27 18:49:50

+0

@MatrixFrog No. – 2015-01-02 04:34:31

回答

37

您可以解决此通过键入文字标签到您的命令:

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

^V是什么? – three 2012-03-22 19:30:55

32

我找不到一个选项卡,将工作一个正则表达式的符号,但是如果可以的话它会高兴地搜索文字标签在bash中,这将是

git grep $'\t' 
相关问题