title: Solve cherry-pick conflicts between diverged branches without committing
body: <p><em><strong>Edit:</strong> beware, this is a confused question. It starts with some wrong assumptions and figures that out, one <em>edit</em> after the other.</em></p>
  <hr />
  <p>I got two branches (<em>master</em> and <em>feature</em>) that diverged.</p>
  <pre><code>master  - C1 - C3
              \
  feature      C2 - C4 - C5
  </code></pre>
  <p>C2 and C4 are just dirty commits with temporary code, that I don't want to have into the final merge/rebase of the two branches.</p>
  <p>I usually perform a:</p>
  <pre><code>git checkout master
  git cherry-pick C5 (last commit from the feature branch)
  </code></pre>
  <p>But this time I have C3 that conflicts and I cannot pick the commit.</p>
  <p>What I tried is rebasing C3 into the <em>feature</em> branch, so to not have conflicts when cherry-picking.</p>
  <pre><code>git checkout feature
  git rebase master
  </code></pre>
  <p>Now I got this</p>
  <pre><code>master  - C1 - C3
                  \
  feature          C2 - C4 - C5
  </code></pre>
  <p>Seems fine, but if I try to <em>cherry-pick</em> again onto master I still get conflicts (on some empty space I removed from some files).<br />
  <em><strong>A posteriori:</strong> can't workaround git conflicts. Rebase does no magic on there.</em></p>
  <p>Git is telling me to resolve the conflicts, to add the files, and commit.
  I can solve the conflicts manually, but don't want to commit them just as a conflict resolution.</p>
  <p><strong>I want to avoid commits in my history about something that is not related directly to implementations.</strong> I would not even know what to write as commit message.</p>
  <ul>
  <li>Why I still get conflicts after the <em>rebase</em>? <em>(<strong>A posteriori:</strong> because <code>rebase</code> just moves copies of commits, has no power to resolve conflicts)</em></li>
  <li>And how can I get C5 to be merged/cherry-picked to <em>master</em> without additional commits? <em>(<strong>A posteriori:</strong> by solving the conflict in a previous commit)</em></li>
  </ul>
  <p><em>I usually prefer to cherry-pick cause I can avoid the 'useless' merge commit and have just commits regarding code changes. Then after that I delete the branch, after a while I'm sure I don't need it anymore.</em><br />
  <em>(<strong>A posteriori:</strong> practically, a rebase workflow)</em></p>
  <p><strong>[[ EDIT ]]</strong></p>
  <p>The wierd behaviour is that C5 and C3 conflict on files that are not changed on C3.</p>
  <p>Infact, all the detected conflicts are just empty on the master branch</p>
  <pre><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
  =======
  [ added code ..................... ]
  [ .......... from ................ ]
  [ ............... 'feature' branch ]
  &gt;&gt;&gt;&gt;&gt;&gt;&gt; 581g52d... &quot;Commit message from 'feature' C5 &quot;
  </code></pre>
  <p>What I need to <em>'solve'</em> is just deleting the conflict tags from the conflicting files.</p>
  <ul>
  <li>I don't get the reasons of the conflicts  <em>(<strong>A posteriori:</strong> the highlighted lines of code that were added in C5 <code>581g52d</code> are removed in C3; git cannot decide which change has priority and was intended to stay)</em></li>
  <li>I would like to solve it manually and then <em>merge/cherry-pick</em> without having to create a new additional (merge) commits</li>
  <li>
  <ul>
  <li>cause the commit will just solve some conflicts with a branch that in the future will be deleted <em>(<strong>A posteriori:</strong> this is not bad, as it gives a hint of the workflow; although in the rebase workflow I follow usually the sequence of commit <em>appears</em> like it was a single flow of work with no branches used)</em></li>
  </ul>
  </li>
  <li>
  <ul>
  <li>when deleted the branch, that commit will have no sense/position in the repository history  <em>(<strong>A posteriori:</strong> see previous point)</em></li>
  </ul>
  </li>
  </ul>
  <p><strong>[[ EDIT 2 ]]</strong></p>
  <p>Moreover, if I try to <code>git cherry-pick</code> <em>master/C3</em> to <em>feature</em> I get:</p>
  <blockquote>
  <p>no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
  The previous cherry-pick is now empty, possibly due to conflict resolution.</p>
  </blockquote>
  <p>I don't get why I have conflicts in the opposite direction (from <em>feature</em> to <em>master</em>)</p>
  <p><strong>[[ EDIT 3 - Retrying from the beginning! ]]</strong></p>
  <p>Here is what I tried too.</p>
  <ul>
  <li><p>Made two copies of the <em>master</em> branch, with C3 as last commit, named: <em>master_copy</em> and <em>repeat_feature</em></p>
  </li>
  <li>
  <ul>
  <li><code>git checkout master</code> / <code>git branch master_copy</code> / <code>git branch repeat_feature</code></li>
  </ul>
  </li>
  <li><p>Cherry-picked every commit from the <em>feature</em> branch, until C5, into <em>repeat_feature</em></p>
  </li>
  <li>
  <ul>
  <li><code>git checkout repeat_feature</code> / <code>git cherry-pick C2^..C5</code> (from <em>feature</em>)</li>
  </ul>
  </li>
  <li>
  <ul>
  <li><em>(I got <strong>NO CONFLICTS</strong>)</em></li>
  </ul>
  </li>
  <li><p>Tried to cherry-pick C5 into <em>master_copy</em>, from <em>repeat_feature</em></p>
  </li>
  <li>
  <ul>
  <li>remember that <em>repeat_feature</em> was started from C3 (so, if there were some conflict, those should be raised while cherry-picking from C2 to C5)</li>
  </ul>
  </li>
  <li>
  <ul>
  <li><code>git checkout master_copy</code> / <code>git cherry-pick repeat_feature_C5</code></li>
  </ul>
  </li>
  </ul>
  <p>I still got the same conflicts!<br />
  <em>(<strong>A posteriori:</strong> can't workaround it, don't avoid conflict resolution)</em></p>
  <p><strong>Even if I was starting from the same C3 commit (when cloned the branch to <em>repeat_feature</em> branch) and trying to <em>cherry-pick</em> to the same C3 commit (into <em>master_copy</em>)!</strong></p>
  <p>I totally don't get the point of what's happening and why I get these empty conflicts that prevent me from moving my feature to the master branch.</p>
  <p>An expert's suggestion is needed here.</p>