Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate tag and make local changes, then rebase against public branch
    primarykey
    data
    text
    <p>We have a situation in which (for this example) we have a straight line of development that is preparing for a release:</p> <pre><code>A --&gt; B --&gt; C --&gt; D ^ HEAD </code></pre> <p>We decide that commits <code>C</code> and <code>D</code> are too forward-thinking, and we want to do the release from <code>B</code>. We have a tool that will go back and tag <code>B</code> as our release version, say <code>product-1.0.0</code>, and will then update a number of versioning files to <code>1.1.0</code>, or whatever version is next.</p> <p><strong>The problem is the creation of the tag, and the tweaking of the files, is an atomic operation.</strong> We can change this, but it's a little bit more hassle.</p> <p>So while the tag needs to point at <code>B</code>, we want our file changes to be popped into a new commit. What we currently have:</p> <pre><code> v detached, tagged, with local changes | A --&gt; B --&gt; C --&gt; D ^ HEAD </code></pre> <p>But, if we commit from our current point, we end up with:</p> <pre><code> /--&gt; E (a 'lost' commit) / A --&gt; B --&gt; C --&gt; D ^ tag ^ HEAD </code></pre> <p>What is the easiest way, either from the "detached with local changes" point, or from the "lost commit" point, to merge either our local changes, or our new commit, to the public branch so that it looks like:</p> <pre><code>A --&gt; B --&gt; C --&gt; D --&gt; E ^ tag ^ NEW HEAD </code></pre> <p>The commits <code>C</code> and <code>D</code>, as well as the entire branch, is public - so we can't really inject commit <code>E</code> between <code>B</code> and <code>C</code>. It's okay if those commits (<code>C</code> and <code>D</code>) exist as 'newer' <code>1.0.0</code> versions of the product we're releasing, we just want to create a new commit on top of the current <code>HEAD</code>.</p> <p><strong>Is there a better way than stashing, checking out <code>HEAD</code>, then popping and committing?</strong></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.
 

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