Carles Company
Carles Company

Reputation: 7216

Move a fix from a branch to the default branch

I have a mercurial repository with two branches (default and branch1) I have a fix that I wanted to do on default but I made it in branch1. I don't want to merge from branch1 to default. Is there a way to move that fix to the default branch without moving anything else?

Upvotes: 0

Views: 61

Answers (2)

umar
umar

Reputation: 4389

You can use transplant, https://www.mercurial-scm.org/wiki/GitConcepts but it requires the transplant extension.

Upvotes: 1

Martin Geisler
Martin Geisler

Reputation: 73788

If you commit a changeset on the wrong branch, then you have two options:

  1. copy the changeset to the right branch with transplant. The change will now appear twice in your history, but standard three-way merge will deal with that just fine. I've described that scenario in my guide to named branches.

  2. move the changeset to the right branch with something like mq. This should only be done for changesets that haven't been pushed anywhere since you're editing history.

Upvotes: 1

Related Questions