title: Can git's .gitattributes treat all files as binary except a few exceptions?
body: <p>I have a particular need for git to treat most file extensions as binary except a few extensions.</p>
  
  <p>I'd like to treat all file extensions as binary, .pdf .doc .xls etc., except plain text files such as .txt .rb .py etc.</p>
  
  <p>I've tried configuring .gitattributes like below to see how this might work:</p>
  
  <pre><code># cat .gitattributes 
  * binary
  *.txt text
  </code></pre>
  
  <p>I thought perhaps the order in the configuration file would matter but it doesn't appear to. With the above configuration all files are still treated as binary. </p>
  
  <p>Is there a way to configure .gitattributes or git any other way to treat all files one way, as binary, except for a few exceptions?</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>I tried the .gitattributes described below. It works!</p>
  
  <pre><code># cat .gitattributes 
  *.txt crlf diff
  * binary
  
  
  # git diff
  diff --git a/file b/file
  index d929b94..bee5cb1 100644
  Binary files a/file and b/file differ
  
  diff --git a/file.txt b/file.txt
  index 632ae98..93d22b0 100644
  --- a/file.txt
  +++ b/file.txt
  @@ -1 +1,3 @@
   Hey this is a .txt file
  +Adding another line
  +A new line
  </code></pre>
  
  <p><strong>Update 2:</strong></p>
  
  <p>I believe crlf and text are the same i.e. the two below configurations for .gitattributes are the same:</p>
  
  <pre><code># cat .gitattributes 
  *.txt crlf diff
  * binary
  
  # cat .gitattributes 
  *.txt text diff
  * binary
  </code></pre>