title: git remove trailing whitespace in new files before commit
body: <p>I know removing trailing whitespace can be done with a pre-commit hook. I am interested in doing it manually. I read the question here:<br>
  <a href="https://stackoverflow.com/questions/591923/make-git-automatically-remove-trailing-whitespace-before-committing">Make git automatically remove trailing whitespace before committing - Stack Overflow</a><br>
  The answer closest to what I want is <a href="https://stackoverflow.com/a/15398512/894506">the "automatic version" from ntc2</a>:
  <Br><br></p>
  
  <pre><code>(export VISUAL=: &amp;&amp; git -c apply.whitespace=fix add -ue .) &amp;&amp; git checkout . &amp;&amp; git reset
  </code></pre>
  
  <p><br>
  That command works well except it seems to be only for changes on files that are already in the repo, not new files. I have a bunch of files that are new, meaning they aren't yet in the repo. I want to remove whitespace from those files so I tried add -A instead of -u but that didn't make a difference.</p>