Thread (17 messages) flat view 17 messages, 10 authors, 2016-06-15

Re: Really beginner on Version Control

From: Enrico Weigelt <hidden>
Date: 2016-06-15 22:49:36

* FernandoBasso [off-list ref] wrote:

Hi,
Why do we merge, say a testing branch into the master branch ? 
What is the use of it ?
That heavily depends on your workflows.

I'm a big friend of topic-branches, which means that I'm alsways
working on one topic (eg. fixing one particular bug or developing
some feature) in it's own branch. When it's decided that the code
is ready to go mainline, it will be merged into there (normally
the "master" branch).

And I really advise rebasing the topic branch onto the mainline,
which means, the changes that happened in the topic branch after
the forkoff, will be applied step by step ontop the mainline,
so coming after those happend meanwhile in the mainline.
(use the -ff option on merge if it should show up in history
as merge instead of sequential additions - see "fast forward").
This can reduce the chance of conflicts dramatically and make
them easier to resolve.
When there is a conflict when merging branches (merging the
testing into the current branch), should I edit the 'current' 
branch or the 'testing' branch ?
You can resolve the conflict within the merge (git will tell you
the conflicts and leave conflict markers in the source code - 
see "resolving conflicts").

As said above, I always rebase the to-be-merged branch ontop
the destination and resolve conflicts there. After this there
can be no conficts as the rebased branch is now an direct
descendant of the merge target (so, fast-forward possible).
Should both branches have exactly the same code so that they 
can be merged without conflicts ?
Obviously not - in this case you wouldn't even need a merge.


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help