git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Really beginner on Version Control

From
EWEnrico Weigelt <weigelt@metux.de>
Date
Sep 21, 2010, 14:59 UTC
Message-ID
<20100921145922.GA14711@nibiru.local>
In-Reply-To
<1285080133451-5555023.post@n2.nabble.com>
* FernandoBasso <FernandoBasso.br@gmail.com> 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
----------------------------------------------------------------------
Previous: Thomas MoulardNext: Eric Raible
Message 3 of 17 in “Really beginner on Version Control”
  1. FernandoBassoSep 21, 2010
  2. Thomas MoulardSep 21, 2010
  3. Enrico WeigeltSep 21, 2010
  4. Eric RaibleSep 24, 2010
  5. Enrico WeigeltSep 24, 2010
  6. FernandoBassoSep 24, 2010
  7. Andreas EricssonSep 21, 2010
  8. Jakub NarebskiSep 21, 2010
  9. FernandoBassoSep 22, 2010
  10. Andrew KellerSep 22, 2010
  11. FernandoBassoSep 22, 2010
  12. FernandoBassoSep 22, 2010
  13. Tor ArntsenSep 22, 2010
  14. Dmitry PotapovSep 22, 2010
  15. Thomas HochsteinSep 22, 2010
  16. Dmitry PotapovSep 22, 2010
  17. Dmitry PotapovSep 22, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.