Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A common practice is to create a topic branch for your incremental changes based on the branch that's most suitable for developing the particular topic / feature / bugfix sought. Then the topic branch is merged into both your branches and discarded. The merge will not overwrite your history, on the contrary, it will all be there, fully preserved.</p> <pre><code> /-- * -- * -- * -- A *-- old history -- * \-- * -- * -- * -- * -- B </code></pre> <p>As you've described, the assumption is that <code>A</code> and <code>B</code> will never merge in the future. When you need to add a feature you pick either A or B, whichever is more natural for that particular case, and develop there:</p> <pre><code> /-- * -- * -- * -- C /-- * -- * -- * -- A *-- old history -- * \-- * -- * -- * -- * -- B </code></pre> <p>Then merge C to both A and B and discard it:</p> <pre><code> /-- * -- * -- * -- C --\ /-- * -- * -- * ----------------------*[merge] -- A *-- old history -- * \-- * -- * -- * -- .. --*[merge] -- B </code></pre> <p>(I missed my chance to take ASCII art lessons from Henri Matisse.)</p> <p>Here's something very straightforward:</p> <pre><code>$ git checkout A $ git branch C $ git checkout C $ develop.sh 24h commit commit commit $ git checkout A $ git merge C $ git checkout B $ git merge C $ git branch --delete C </code></pre> <p>You should be able to see much nicer ASCII art by now running: $ git log --oneline --graph You'll see that merge didn't destroy any of your history. Of course you don't need --graph for this, it is also visible with just plain <code>git log</code>. </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. 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