title: Add files to .gitignore directly from git shell
body: <p>I'm trying to add a specific file to .gitignore directly from git shell.  File to ignore is <code>token.mat</code></p>
  
  <p>If I type:</p>
  
  <pre><code>touch .gitignore
  </code></pre>
  
  <p>and then manually open .gitignore with a text editor and add </p>
  
  <pre><code>token.mat
  </code></pre>
  
  <p>save and close, it works, git ignores it (when I type git status at the git shell I no longer see token.mat)</p>
  
  <p>However at the git shell if I type:</p>
  
  <pre><code>touch .gitignore
  echo 'token.mat' &gt;&gt; .gitignore
  </code></pre>
  
  <p>then git does not ignore token.mat, when I type git status I still see it.  However when I open .gitignore with a text edit I see token.mat listed and it looks exactly the same as when I add it manually.</p>
  
  <p>Does anyone know why this is, or how I can add files to .gitignore directly from the git shell?</p>
  
  <p>Thanks for any help in advance!!</p>
  
  <p>Other details:</p>
  
  <ul>
  <li>Windows 7 Professional, service pack 1  </li>
  <li>git version: 2.5.3.windows.1</li>
  <li>text editor: Notepad ++</li>
  </ul>