コマンド
CRLF→LFの場合
LF→CRLFの場合はunix2dosを使えば同様にできそう(試してない)
$ git --version
git version 2.19.1.windows.1
$ git grep --cached -l -I $'\r$' | xargs dos2unix
git grep のオプション
--cached
Instead of searching tracked files in the working tree, search blobs registered in the index file.
ワーキングツリー内の追跡されたファイルを探さず、インデックスファイルに登録されたブロブを探す。
-I
Don’t match the pattern in binary files.
バイナリファイル内のパターンにはマッチさせない。
-l
--files-with-matches
--name-only
-L
--files-without-match
Instead of showing every matched line, show only the names of files that contain (or do not contain) matches. For better compatibility with git diff, --name-only is a synonym for --files-with-matches.
マッチした行は表示せずファイル名だけを表示する。
オプション解説でどころ
Git - git-grep Documentation