title: How to clean up line-endings with Git
body: <p>I'm quite inexperienced with Git, and this one baffles me:</p>
  
  <p>I just switched my working copy to another branch (a simple <code>git checkout master</code>), and immediately after that, <code>git status</code> tells me about hundreds of changed files.  However, it's all about line endings;  a <code>git diff --ignore-space-at-eol</code> gives me a lot of warnings:</p>
  
  <pre><code>warning: CRLF will be replaced by LF in src/.../somefile.js.
  The file will have its original line endings in your working directory.
  </code></pre>
  
  <p>I generally consider it a bad idea to have DOS-style line endings in versioned text files, but this is what they have been committed like in the first place;  I did this in a Linux box, and the files I got have CRLF line endings.</p>
  
  <p>What is the best way to clean up in my situation?  Should I change the line ending of every single file and commit this?</p>
  
  <p>How can Git be configured to avoid such situations in the future?</p>