Git リポジトリのルートで以下を実行。
$ git ls-tree -r HEAD | cut -f1 | cut -d ' ' -f3 | xargs -i{} sh -c 'git rev-list --objects --all | grep {}' | cut -d ' ' -f2 | tr '\n' '\0' | xargs -0 -i{} file -Z {} | grep -i crlf | sed -e 's/:[^:]*$//' | tr "\n" "\0" | xargs -0 -iF awk 'BEGIN{RS="\r";ORS="\n";c=""} { c=c "" $0} END{printf("%s", c) > ARGV[1]}' F2020-10-25追記: 最初のバージョンではパス名に細工されるとコマンドを挿入できてしまう脆弱性がありました(上記のものは対応はしてあります)。