title: Git check out a specific file type with LF line endings on Windows
body: <p>On Windows, I would like to check out all linux shell files (.sh) with LF line endings</p>
  
  <p>Line Endings of other text-based files should be converted to CRLF. (which is handled via the global core.autocrlf=true)</p>
  
  <ul>
  <li>global .gitconfig</li>
  </ul>
  
  <p><code>[core]
      editor = 'C:/Tools/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
      autocrlf = true</code></p>
  
  <ul>
  <li>.gitattributes in repository root folder</li>
  </ul>
  
  <p><code>*.sh text eol=lf</code></p>
  
  <p>I used <code>git add --renormalize .</code> when adding the .gitattributes file.</p>
  
  <p>Unfortunately the .sh files still have CRLF after checkout.</p>
  
  <hr>
  
  <p>additional information: One of my team members did change his global core.autocrlf=false some commits ago, which caused the chaotic line endings, I guess.</p>
  
  <p>With above mentioned steps I could at least fix files of the local repository to have CRLF endings again.</p>
  
  <hr>
  
  <p>steps tried:</p>
  
  <ul>
  <li>delete files locally and checkout again: no affect - all CRLF</li>
  <li>delete files, push deletion, recreate files with LF: still CRLF after checkout</li>
  <li>manually change line endings with Notepad++...</li>
  </ul>
  
  <p><code>user@workstation MINGW64 /c/repos/project-source (bug_sh_files_eol_lf)
  $ git status
     On branch bug_sh_files_eol_lf
     Your branch is up to date with 'origin/bug_sh_files_eol_lf'.
     Changes not staged for commit:
       (use "git add &lt;file&gt;..." to update what will be committed)
       (use "git restore &lt;file&gt;..." to discard changes in working directory)
             modified:   production_code/build_production_code.sh
             modified:   test_code/unit_tests/create_unit_test_xml.sh
     no changes added to commit (use "git add" and/or "git commit -a")
  user@workstation MINGW64 /c/repos/project-source (bug_sh_files_eol_lf)
  $ git add . -u
     warning: LF will be replaced by CRLF in production_code/build_production_code.sh.
     The file will have its original line endings in your working directory
     warning: LF will be replaced by CRLF in test_code/unit_tests/create_unit_test_xml.sh.
     The file will have its original line endings in your working directory
  user@workstation MINGW64 /c/repos/project-source (bug_sh_files_eol_lf)
  $ git status
     On branch bug_sh_files_eol_lf
     Your branch is up to date with 'origin/bug_sh_files_eol_lf'.
     nothing to commit, working tree clean
     user@workstation MINGW64 /c/repos/project-source (bug_sh_files_eol_lf)</code></p>