title: EGit push to remote is opposite what I expect it to do
body: <p>This is what I want to do:</p>
  
  <ul>
  <li>use Eclipse and Git (EGit)</li>
  <li>use EGit to clone a remote repository to my local copy</li>
  <li>make changes to my local copy</li>
  <li>push those changes back to the remote repository</li>
  </ul>
  
  <p>This is what I see:</p>
  
  <ul>
  <li>after the push, the staged changes on the remote repository are the opposite to the changes I made.</li>
  </ul>
  
  <p>Let me give an example and maybe someone can tell me where I have gone wrong.</p>
  
  <ul>
  <li>I create a directory called <code>C:\GIT\remote</code> which contains a file called <code>readme.txt</code> which contains the string <code>Hello World!</code></li>
  <li><p>I turn this into a Git repository, I stage the <code>readme.txt</code> file, it shows:</p>
  
  <pre><code>new file mode 100644
  @@ -0,0 +1 @@
  +Hello World!
  </code></pre></li>
  <li><p>I commit this change at the remote repository. The remote repository contains no unstaged changes</p></li>
  <li><p>Start Eclipse, <code>import-&gt;Projects from Git-&gt;Clone URI</code>. Location URI = <code>C:\GIT\remote</code>, <code>Next</code>, <code>Next</code>, Destination Directory: <code>C:\GIT\local</code>, <code>Next</code>, <code>Import as General Project</code>, <code>Next</code>, <code>Finish</code></p></li>
  <li><p>This creates a git repository in <code>C:\GIT\local</code>, with the <code>readme.txt</code> file and a .project file. As expected.</p></li>
  <li><p>In Eclipse, I open the <code>readme.txt</code> file and edit it to say <code>Goodbye World!</code>. Save. </p></li>
  <li><p>Right click on project in Project Explorer and: <code>Team-&gt;Commit</code></p></li>
  <li><p>Files to change are: <code>readme.txt</code> and <code>.project</code>. I enter a commit message "made changes" and click <code>Commit</code>.</p></li>
  <li><p>Eclipse now shows that the local repository is 1 commit ahead of the remote repository. (Am I right?)</p></li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/Ei1ZU.png" alt="After first local commit"></p>
  
  <ul>
  <li>Right click on project in Project Explorer and: <code>Team-&gt;Push to Upstream</code> and it shows my comment and the remote repository details:</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/FRZjS.png" alt="Push window"> </p>
  
  <ul>
  <li>Now, when I look at the Staged files on my remote repository, I see this:</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/drrDt.png" alt="Reversed patches"></p>
  
  <p>It's showing that the <code>.project</code> file needs to be removed (instead of being added), and that the change to the <code>readme.txt</code> file should be the reverse of the change I just made:</p>
  
  <pre><code>    @@ -1 +1 @@
      -Goodbye World!
      +Hello World!
  </code></pre>
  
  <p>The <code>C:\GIT\remote\readme.txt</code> file contains the string "Hello World!". The staged patch doesn't even make sense according to the contents of the file.</p>
  
  <p>I am puzzled.</p>