Re: Really beginner on Version Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* FernandoBasso <FernandoBasso.br@xxxxxxxxx> 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@xxxxxxxx
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]