title: Line Endings AutoDetect in Windows and Linux
body: <p>I've seen this question asked a lot, and I've read through the material on it.</p>
  
  <p>I'm still confused, and I've come across some conflicting opinions.</p>
  
  <p>In my environment, development happens on both Windows and Linux machines. The files in question have no extension, but contain text, and are required to have LF endings to comply on the Linux side.</p>
  
  <p>I want to create a .gitattributes file so that only one change is necessary, centrally. </p>
  
  <p>I'm specifying all files as binary (such as image and audio) to avoid every single file being converted, as well as creating rules for other files.</p>
  
  <p>I've seen advise on using:</p>
  
  <pre><code>* text=auto
  </code></pre>
  
  <p>According to another stack overflow post here:</p>
  
  <blockquote>
    <p>Here's what * text=auto does in my words: when someone commits a file,
    Git guesses whether that file is a text file or not, and if it is, it
    will commit a version of the file where all CR + LF bytes are replaced
    with LF bytes. It doesn't directly affect what files look like in the
    working tree, there are other settings that will convert LF bytes to
    CR + LF bytes when checking out a file.</p>
  </blockquote>
  
  <p>This seems wrong for my purposes.</p>
  
  <p>When the repository is cloned from a Linux machine, and a branch checked out, it sounds like it will convert it to CRLF in the working directory.</p>
  
  <p>Do the line endings in the working directory depend on the OS? Does it autodetect?</p>
  
  <p>I need it to be LF in the working directory on Linux. On Windows I don't much care. But it needs to be LF on both Linux and in the remote repository</p>
  
  <p>Will <code>* text=auto</code> accomplish what I'm looking for?</p>
  
  <p>Would <code>* text=auto eol=lf</code> work better for my purposes?</p>
  
  <p>Thanks in advance</p>