title: git checkout automatically merges local modifications
body: <p>I tried following commands on the shell   </p>
  
  <pre><code>git init
  
  echo "test1" &gt; test1.txt
  git add test1.txt
  git commit -a -m "test1"
  
  echo "test2" &gt;&gt; test1.txt
  
  git branch test
  git checkout test
  </code></pre>
  
  <p><code>text.txt</code> now contains:</p>
  
  <pre><code>test1
  test2
  </code></pre>
  
  <p>After checkout to branch <code>test</code> all local modifications from <code>master</code> get merged.</p>
  
  <p>Why? </p>
  
  <p>I expected that <code>git</code> refuses checkout to <code>test</code> because of the local changes. I expected that git asks for a commit or <code>stash</code> the local changes.</p>
  
  <p>Edit:
  I used a bash script to execute this commands. I get following output:</p>
  
  <pre><code>r@r:/tmp/test$ ./createrepo 
  Initialized empty Git repository in /tmp/test/.git/
  [master (root-commit) 0407f5b] test1
   1 file changed, 1 insertion(+)
   create mode 100644 test1.txt
  M       test1.txt
  Switched to branch 'test'
  </code></pre>