title: Why does IntelliJ change line separators on save from CRLF to LF
body: <ul>
  <li>I do not have IntelliJ's "Save Actions" plugin installed.</li>
  <li><code>git config core.autocrlf</code> => true</li>
  <li><code>git config core.safecrlf</code> => true</li>
  <li>Running Windows 10 for my sins</li>
  <li>The corresponding <code>.gitattributes</code> file has <code>* text=auto</code></li>
  </ul>
  
  <p>I have a git repo checked out onto a Windows box. IntelliJ initially shows the files are initially CRLF line-separators (correct as I'm running Windows). </p>
  
  <ul>
  <li>When I save an existing (Java) file in IntelliJ, the line-separators are CHANGED TO LF. </li>
  <li>When I save the file via Notepad++ or VSCode, the line-separators are NOT CHANGED.</li>
  </ul>
  
  <p>This means that when I do a <code>git add</code> it fails with <code>fatal: LF would be replaced by CRLF in &lt;file&gt;</code>.</p>
  
  <p>FWIW</p>
  
  <ul>
  <li>Checkout git repo via Windows Console, or Git Bash console makes no difference</li>
  <li>At some point in the past I cloned via Ubuntu on WSL, but I've since done a clean clone into a new folder.</li>
  </ul>
  
  <p>Are there any IntelliJ settings to stop it changing CRLF -> LF? </p>
  
  <p>The workaround is to use <code>--ignore-errors</code>, e.g. <code>git add --ignore-errors &lt;file&gt;</code> but that's annoying.</p>