{"thread":{"id":"20724","subject":"git list binary and/or non-binary files?","startedAt":"2009-08-24T21:50:43Z","lastAt":"2009-08-24T22:39:57Z","messageCount":3,"participants":["skillzero@gmail.com","Johan Herland"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"121678","messageId":"2729632a0908241450m1651c77ata9744058c5d42672@mail.gmail.com","threadId":"20724","inReplyTo":null,"subject":"git list binary and/or non-binary files?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-08-24T21:50:43Z","receivedAt":"2009-08-24T21:50:43Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"Is there a way to list the files git considers binary in a repository\n(and alternatively, the ones it considers text)? I have a large\nrepository and I want to fix line endings for text files that were\naccidentally checked in using CRLF and can't just use the file\nextension alone because some files with the same extension may be\nbinary and others not (e.g. UTF-8 .strings file is text, but a UTF-16\n.strings file is binary...git already figured out based on the content\nthat one is binary).\n\nI thought maybe git ls-files, but I didn't see anything in there I can\nuse for binary vs text.\n"},{"id":"121680","messageId":"200908250014.03585.johan@herland.net","threadId":"20724","inReplyTo":"2729632a0908241450m1651c77ata9744058c5d42672@mail.gmail.com","subject":"Re: git list binary and/or non-binary files?","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-08-24T22:14:03Z","receivedAt":"2009-08-24T22:14:03Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Monday 24 August 2009, skillzero@gmail.com wrote:\n> Is there a way to list the files git considers binary in a repository\n> (and alternatively, the ones it considers text)? I have a large\n> repository and I want to fix line endings for text files that were\n> accidentally checked in using CRLF and can't just use the file\n> extension alone because some files with the same extension may be\n> binary and others not (e.g. UTF-8 .strings file is text, but a UTF-16\n> .strings file is binary...git already figured out based on the content\n> that one is binary).\n>\n> I thought maybe git ls-files, but I didn't see anything in there I can\n> use for binary vs text.\n\nI use the following to list files that contain CRs, but that are not \nconsidered binary by Git:\n\n  git grep --cached -I -l -e $'\\r'\n\n'git help grep' explains all the options...\n\n\nHave fun! :)\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"121685","messageId":"2729632a0908241539l7243c9a4v170e14140b45cb0b@mail.gmail.com","threadId":"20724","inReplyTo":"200908250014.03585.johan@herland.net","subject":"Re: git list binary and/or non-binary files?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-08-24T22:39:57Z","receivedAt":"2009-08-24T22:39:57Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"On Mon, Aug 24, 2009 at 3:14 PM, Johan Herland<johan@herland.net> wrote:\n\n> I use the following to list files that contain CRs, but that are not\n> considered binary by Git:\n>\n>  git grep --cached -I -l -e $'\\r'\n\nThanks, that's what I needed. I needed it to build a list to pass to a\nscript so I used 'git grep -I --name-only -z -e \"\" | xargs -o ...'\n"}]}