MorayM
MorayM

Reputation: 2687

How to move fixes developed on branch to another

We currently have a release branch (from master) on which we are developing features and bugfixes. We've discovered that we need to release some of these fixes early and so need to extract them from the release branch and drop them onto master.

What's the easiest way of getting from

A--B--C master
       \
        D--E--F--G--H--I--J--K release

to

A--B--C--F--G--J master
       \
        D--E--F--G--H--I--J--K release

?

I could cherry-pick the merge commits from release onto master but will that cause headaches when release is eventually merged into master?

Upvotes: 0

Views: 166

Answers (1)

kalatabe
kalatabe

Reputation: 2989

I would:

  1. Create a new branch hotfix from current state of master. That would point to C
  2. Cherry-pick commits (not merge requests) F, G and J into hotfix.
  3. Open a merge request from hotfix to master

Upvotes: 1

Related Questions