Merging two branches without actually merging

This looks like a fairly common and straightforward requirement, but I’ve looked into transplant extension, rebase, import, export, etc, and I have yet to figure it out. Hopefully I am missing out something obvious.

I would like to “merge” two branches (named branches, to be specific) such that the branches themselves don’t go away. Essentially, I want to pull changes from a revision but manually resolve cherrypick changes/conflicts (using my merge program).

  • Mercurial — revert back to old version and continue from there
  • Why should a business use distributed version control?
  • Git for Web Development (procedure method)
  • Branching in Mercurial
  • What is the Fork & Pull Model in GitHub?
  • Do you use distributed version control?
  • It seems that import, export, transplant, etc generate patches and changesets that are directly applied to the current working directory. But I don’t want that… instead, I want to manually determine what changes go in.

    Appreciate your help.

  • Tagging XCode's Archive builds in Git or another SCM
  • Cleanup git master branch and move some commit to new branch?
  • In Hudson, how do I get the current build's git commit sha?
  • Can Git hook scripts be managed along with the repository?
  • pushing to git remote branch
  • Visual studio 2010 git extention manage remotes unable to connect
  • 3 Solutions collect form web for “Merging two branches without actually merging”

    I would like to “merge” two branches (named branches, to be specific) such that the branches themselves don’t go away.

    This is the default behavior. For example, if you look at the default branch of the mercurial source code, you’ll see that it regularly merges with stable. These merges do not make default or stable disappear. The merge commit just gets the local branch name.

    I want to manually determine what changes go in.

    Sounds to me like transplant already does that. Alternatively, you can make each change on its own feature branch and then you have full control over which features get merged into a branch.

    update: there is now also a core graft command.

    It looks like you could use a third branch, a consolidation branch, where you can merge whatever changeset you need from the other two branches.
    You can then use (here for Git) a combination of:

    git cherry-pick SHA1 --no-commit
    git add --patch
    

    to really fine-tune exactly what you need to import/merge in that third branch, as described in the SO question “Using GIT, how can I selectively pull / merge changes from anothers ‘fork’?”

    If you use git, take a look at merge strategies.

    Git Baby is a git and github fan, let's start git clone.