Is it possible to git grep for tabs?

前端 未结 3 573
甜味超标
甜味超标 2020-12-14 01:01

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

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

However, using git gre

相关标签:
3条回答
  • 2020-12-14 01:02

    On Windows, the following works in PowerShell:

    git grep "`t"
    
    0 讨论(0)
  • 2020-12-14 01:18

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

    # type it with ^V then tab
    git grep '  '
    
    0 讨论(0)
  • 2020-12-14 01:21

    I cannot find a regexp notation for a tab that will work, but it will happily search for a literal tab if you can pass one in. In bash, that would be

    git grep $'\t'
    
    0 讨论(0)
提交回复
热议问题