title: Git messing up line endings despite .gitattributes
body: <p>I have already seen <a href="https://stackoverflow.com/questions/41496664/gitattribute-end-of-line-setting">gitattribute end of line setting</a> and this is a different and quite bizarre problem.  I have already checked my autocrlf and eol configurations and they are not set</p>
  <p>I'm on a Mac.  In our repository we have a .gitattributes file that looks like this:</p>
  <pre><code>*.sql text eol=lf
  *.sh text eol=lf
  </code></pre>
  <p>This works perfectly for .sql files.  However we have a file named <code>scripts/some-version.SQL</code>.  It is checked in with Unix lf endings.  When I check it out on OS X, that file immediately gets converted to dos crlf endings and is marked as changed.  Checking the same file out on Windows gives a Unix lf ending.</p>
  <p>If I comment out the <code>.sql</code> line in the .gitattributes file, I stop getting the .SQL file checked out as crlf.  It is the .gitattributes  that is causing this behavior.  However then Windows users will accidentally start checking in crlf endings again.  Changing the filename is sadly not an option.</p>
  <p>I tried adding a <code>.SQL text eol=lf</code> line to .gitattributes but that did not help.</p>
  <p>How can we have a .gitattributes for our Windows users without messing up the line endings for this file on OS X?</p>
  <hr />
  <p>Per request.  A demonstration of the issue, along with <code>check-attr</code>.</p>
  <pre><code>macbookpro:postgres btilly$ git checkout scripts/
  Updated 1 path from the index
  macbookpro:postgres btilly$ git status scripts/3.20.08-UPDATE.SQL 
  On branch integration
  Your branch is up to date with 'origin/integration'.
  
  Changes not staged for commit:
    (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)
    (use &quot;git restore &lt;file&gt;...&quot; to discard changes in working directory)
      modified:   scripts/3.20.08-UPDATE.SQL
  
  no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
  macbookpro:postgres btilly$ git check-attr -a scripts/3.20.08-UPDATE.SQL 
  scripts/3.20.08-UPDATE.SQL: text: set
  scripts/3.20.08-UPDATE.SQL: eol: lf
  macbookpro:postgres btilly$ file scripts/3.20.08-UPDATE.SQL 
  scripts/3.20.08-UPDATE.SQL: UTF-8 Unicode text, with very long lines, with CRLF line terminators
  </code></pre>