Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm fairly new to Git, so please excuse any misunderstandings I may have made in your situation.</p> <p>Using this code snippet:</p> <pre><code>diff -u &lt;(git rev-list --first-parent fix/123) &lt;(git rev-list --first-parent master) | sed -ne 's/^ //p' | head -1 </code></pre> <p>From this answer: <a href="https://stackoverflow.com/a/4991675/88111">@lindes answer to "Finding a branch point with Git?"</a></p> <p>If you have a tree like this:</p> <p><img src="https://i.stack.imgur.com/MSPvN.png" alt="Initial Tree"></p> <p>Then the result of the above command with <code>some-fix</code> in place of <code>fix/123</code> will be:</p> <p><code>f1efa4a9c029281a22d4fa8dd6607c523e7191f5</code></p> <p>Which is the commit at which your initial fix branch was created.</p> <p>You can then also run a quick <code>merge-base</code> to determine where <code>some-fix</code> ends:</p> <pre><code>$ git merge-base master some-fix 1b9ebb7157a958e9adc3b8eda9bf4175cd821c4b </code></pre> <p>And then, using a cherry-pick of the revision range, you can pull those changes in:</p> <pre><code>$ git cherry-pick f1efa4a..1b9ebb7 </code></pre> <p>And you end up with:</p> <p><img src="https://i.stack.imgur.com/zUOQ2.png" alt="Final Tree"></p> <p><strong>Which contains</strong> the additional commits from your initial fix branch. You would want to perform the additional <code>checkout -b</code> to create your <code>fix/123-stable</code> branch, instead of just tacking them on to <code>stable</code>, but the method should be the same.</p> <p><strong>Note also</strong> that the answer I referenced mentions installing that long, tedious <code>diff</code> command as an alias called <code>oldest-ancestor</code>, which should save you a ton of time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload