How to list all text (non-binary) files in a git repository?

前端 未结 3 1416
孤城傲影
孤城傲影 2020-12-09 04:14

I have a repository with a lot of autogenerated source files I\'ve marked as \"binary\" in .gitattributes (they are checked in because not everyone has access t

3条回答
  •  长情又很酷
    2020-12-09 04:39

    A clever hack to achieve this: listing all non-binary files that contains carriage returns

    $ git grep --cached -I -l -e $'\r'
    

    For my case, an empty string works better:

    $ git grep --cached -I -l -e $''
    

    Took it from git list binary and/or non-binary files?.

提交回复
热议问题