title: What is the proper way to do "Checkout with Rebase" and then push the merged files in Intellij IDEA
body: <p>In Git, I have two branches: master and myFeatureBranch (which I created via IDEA's new branch while I was on master). In the time since I created myFeatureBranch, other team members have committed several changes to master. I would like to bring in those changes, and I am aware that I will have merge conflicts.</p>
  
  <p>My general idea of how to deal with this is: </p>
  
  <ul>
  <li>I get all of the commits from master and apply them to my branch</li>
  <li>I deal with any merge conflicts</li>
  <li>I push all of these changes, including the merged files, to the remote branch</li>
  <li>There are no duplicate commits on my remote branch</li>
  </ul>
  
  <p>Intellij IDEA 2016 <a href="https://blog.jetbrains.com/idea/2016/01/intellij-idea-16-eap-improves-editor-and-vcs-integration/" rel="noreferrer">added some new features</a> including Checkout with Rebase. From their announcement:</p>
  
  <blockquote>
    <p>The <em>Checkout with Rebase</em> action is useful if you don’t want to waste your time on extra files synchronization and compilation when you do two operations: Checkout and then Rebase.</p>
  </blockquote>
  
  <p>Sounds like what I'm wanting. I am already on master, so I click on the branch selector at the bottom right of my IDEA window. I navigate to my local branches and choose "Checkout with Rebase".</p>
  
  <p><a href="https://i.stack.imgur.com/L6Tug.png" rel="noreferrer"><img src="https://i.stack.imgur.com/L6Tug.png" alt="Intellij IDEA Checkout with Rebase"></a></p>
  
  <p>After doing this, I am told about my merge conflicts. I choose the "Merge" button and resolve them manually.</p>
  
  <p><a href="https://i.stack.imgur.com/bnN3P.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bnN3P.png" alt="Intellij IDEA Merge Conflict"></a></p>
  
  <p>After I do that, I get a confirmation that my rebase was successful:</p>
  
  <p><a href="https://i.stack.imgur.com/498bU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/498bU.png" alt="Intellij IDEA Rebase Successful"></a></p>
  
  <p>And there are no pending changes:</p>
  
  <p><a href="https://i.stack.imgur.com/git6e.png" rel="noreferrer"><img src="https://i.stack.imgur.com/git6e.png" alt="Intellij IDEA No Pending Changes"></a></p>
  
  <p>Everything looks like it worked. Now I want to push everything, including my merged classes, to my remote branch. So I go to the menu bar and choose VCS -> Git -> Push. But when I do that, I get an error saying that my push was rejected and that I should merge:</p>
  
  <p><a href="https://i.stack.imgur.com/8o2Ue.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8o2Ue.png" alt="Push of current branch &lt;code&gt;myFeatureBranch&lt;/code&gt; was rejected. Remote changes need to be merged before pushing. In this case **merge is highly recommended**, because there are non-pushed merge commits. Rebasing them can lead to problems."></a></p>
  
  <p>I decided to follow the advice and choose "Merge". However, this brought me right back to the merge conflict.</p>
  
  <p><a href="https://i.stack.imgur.com/bnN3P.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bnN3P.png" alt="Intellij IDEA Merge Conflict"></a></p>
  
  <p>If I go through with this and then try pushing it again, it is successful, but I wind up with two copies of the merge.</p>
  
  <p>What am I doing incorrectly with this "Checkout with Rebase" and then pushing my merged files?</p>
  
  <p><sub>Also, <strong>I don't want to do this from the Terminal</strong>. That may be easier for some developers, but I would like to learn how to do it entirely through the IDEA GUI (we have QA and other users who are not as technical as our developers and they have expressed a desire to not have to use the command line, and I'd like to know the best way for them).</sub></p>