2010-11-23 88 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' 
相關問題