git grep by file extensions

后端 未结 3 1417
野的像风
野的像风 2021-01-30 10:18

I know that, if I wanted to grep for a pattern only on files with certain extensions, I could do this:

// searches recursively and matches case insensitively in          


        
3条回答
  •  误落风尘
    2021-01-30 10:37

    if you want to search across all branches, you can use the following:

    git log -Sres --all --name-only -- '*.js'
    

    (I see you specify git grep; to me the approach here seems simpler and easier to remember--more like other operations I need commonly.)

提交回复
热议问题