Hg Merge specific commit from another branch

I have two branches Dev and Feature1. I worked on Feature1, creating the specified function and doing it. Then I wrote the code for Feature2, but passed it in the Feature1 branch instead of the new branch (Feature2). So now I have two functions in the Feature1 branch as two separate commits, but I want to include the second function in Dev.

What is the mercury way to do this?

+5
source share
3 answers
  • Suppose you haven't posted your commits yet:

    If you want to merge a Feature2 commit regardless of commit Feature1, you must move it to your branch .

  • If already published:

    transplant "" Feature2 . backout Feature2 Feature1. merge Feature2 Feature1 .

, , Feature2 , Dev, .

+4

hg graft

Mercurial merge logic . "backporting" "cherry-picking".

: https://www.mercurial-scm.org/repo/hg/help/graft

+10

Dev.

Include in Dev and leave in Feature1 - translpant, as @ oben-sonne mentioned Move completely from Feature1 - rebase If you want to reinstall Feature2, you need to create this branch (Feature1) before rebase

0
source

All Articles