Note that there are some explanatory texts on larger screens.

plurals
  1. POGit rebase workflow - adding bugfixes to a "stable" branch
    text
    copied!<p>For this project I'm working on, we're using a fairly standard git rebase workflow. That is, we'll do all of our work in a <code>feature</code> branch. After a feature is ready to be tested, someone else will:</p> <pre><code>git checkout master git merge feature </code></pre> <p>We also have a <code>stable</code> branch, which is basically a less bleeding-edge copy of <code>master</code>. After the changes in <code>master</code> have been thoroughly tested by others, someone will then:</p> <pre><code>git checkout stable git merge master </code></pre> <p>The problem I'm having is the following situation:</p> <ol> <li><code>master</code> has many new commits compared to <code>stable</code>, since a new feature has just been pushed out for testing.</li> <li>The commits in <code>master</code> are not at all ready to be merged into <code>stable</code>.</li> <li>A bug is discovered in <code>stable</code>, and needs to be fixed right away.</li> </ol> <p>I can't simply add the bugfix to <code>stable</code> and then rebase <code>master</code> on top of it, as others have checked out <code>master</code>. I can't add the bugfix to <code>master</code> and then merge it into <code>stable</code>, because <code>master</code> contains commits which aren't at all ready for use. And, finally, I don't want to just add the bugfix to the end of both <code>stable</code> and <code>master</code>, because this would make the next <code>git checkout stable &amp;&amp; git merge master</code> break.</p> <p>How can I adjust my workflow to accommodate this situation? I'd like to avoid duplicating commits (i.e., <code>stable</code> ending up with the "same commit" twice, with different commit hashes), or merge commits.</p> <p>Currently, since this situation doesn't come up very often, I just rebase <code>master</code> onto <code>stable</code> and make sure everyone else that has it checked out is aware. I'm wondering if there's a more clean way to achieve this, however.</p>
 

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