Skip to content

Instantly share code, notes, and snippets.

@gerhard
Created June 2, 2009 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerhard/122206 to your computer and use it in GitHub Desktop.
Save gerhard/122206 to your computer and use it in GitHub Desktop.
# courtesy of doener from git IRC channel. Thanks man!
A---B---C---D (master)
\ \
\ X---X (topicA)
\
X---X---X (topicB)
(integration branch is somewhere else...)
a) Reset "integration" to "master":
A---B---C---D (master) (integration)
\ \
\ X---X (topicA)
\
X---X---X (topicB)
b) Merge what you need to "integration" (--no-ff)
A---B---C---D (master)
\ \ \
\ \ Ma--Mb (integration)
\ \ / /
\ X---X (topicA)
\ /
X---X---X (topicB)
c) test
d) eventually update "master"
"master" can be fast-forwarded to "integration", leading to:
A---B---C---D---Ma--Mb (master) (integration
\ \ / /
\ \ / /
\ \ / /
\ X---X (topicA)
\ /
X---X---X (topicB)
While a --no-ff would mean:
A---B---C---D--------Mi (master)
\ \ \ /
\ \ Ma--Mb (integration)
\ \ / /
\ X---X (topicA)
\ /
X---X---X (topicB)
# if the test suite isn't successfull, you don't reach step d) and go back to a), so the merges you did in b) get dropped again, and there's only exactly one merge per topic branch
# since you already do --no-ff merges when merging into "integration", master should be fast-forwarded, you already have the per-topic merges, you (usually) don't want yet another one on top
# integration is reset to master, and then only sees --no-ff merges, so there's nothing but merges in it, so a fast-forward adds nothing but merge commits to master
# you should always redo the integration branch from scratch, so you're free to choose what to integrate for this test run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment