Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging branches in Mercurial

Currently I have two branches in a Mercurial repository. One the "default" branch where I do most of my development and another a "production" one where the code that is currently live goes.

My question is how do I "merge" my default branch with the production one.

like image 862
Allister Avatar asked Oct 20 '25 02:10

Allister


1 Answers

You do

$ hg update production
$ hg merge default

to bring in the new stuff from default into the production branch. You'll have to resolve any merge conflicts at this point. There is no chance of data loss since you are working with committed changes. You can abort the merge with hg update -C and you can re-do the merge of a file foo.c with

$ hg resolve foo.c

When you're satisfied with the merge, you run

$ hg commit

to create a merge changeset that describes how the two branches should be merged.

There are many tutorials on this, for example:

  • Mercurial wiki
  • Task based development
like image 138
Martin Geisler Avatar answered Oct 23 '25 11:10

Martin Geisler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!