Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: Advice/help needed

From: Yann Simon <hidden>
Date: 2016-06-15 22:47:43

2009/11/16 Ian Hobson [off-list ref]:
My thoughts are to have 4 branches, one for each customer. 99% of all
changes will be needed by all (or at least most)
of the customers (P,W,S and E). How can I make a change to master and then
use git to apply those changes to the four branches, without losing the
differences between branches?

For example (if this is the best way) go from this
O-----O-----A-----B-----C  (master)
 \----P
 \---W
  \--S
   \-E

to first this, where D is the net effect of A B and C  (this is for ease of
reading logs, and commit messages),
O-----O-----D  (head)  \----P
 \---W
  \--S
   \-E

and then to this, (without editing all the files four times?)
O-----O-----D  (head)
 \----P-----D'
 \---W----D''
  \--S-----D'''
   \-E-----D''''
What I would do is:
- one branch for the common
- one branch for each customer, which contains the specific
differences compare to the common branch

You could program on the common branch.
When you are ready, you can checkout each specific branch and rebase
on the common branch.
For example:
$ git checkout common
edit, test, commit
$ git checkout client1
$ git rebase common
$ git checkout client2
$ git rebase common

Another solution is to have a branch for each customer, to commit on
one branch, and to cherry-pick this last commit on all the other
branches.

Yann
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help