Reputation: 492
I've initially had two branches:
master A---B---C
\
fork D---E---F---H---I
So I wanted to get my fork branch to be merged to master at F, without merging D and E. So it becomes:
master A---B---C-------F---H---I
\
fork D---E
And then I would like to be able to rebase the fork to master, so it becomes:
master A---B---C-------F---H---I
\
fork D---E
(Not sure about the lettering, or should it become D' and E' and have the old ones stay after C)
So I searched around and found that I can branch my fork at "I" and then hard reset it, but it became even more complicated:
master A---B---C
\
fork D---E
\
to-merge F---H---I
(I'm at this point now)
Please, help a noob at branching to make it work. Even it I end up with something like this:
master A---B---C-------F---H---I
\ / \
fork D---E D'--E'
I don't want to merge D and E to the master at all.
Upvotes: 1
Views: 105
Reputation: 2231
I think you may want to look at cherry picking.
Just a quick google brought this up. Looks useful (and like what you need). http://technosophos.com/content/git-cherry-picking-move-small-code-patches-across-branches
First check out master.
$ git checkout master
Then something like this for each cherry pick.
$ git cherry-pick F
Finished one cherry-pick.
Upvotes: 0
Reputation: 3929
If it's only 3 commits, it might be simplest to just cherry-pick them into your master branch.
git checkout master
git cherry-pick F
git cherry-pick H
git cherry-pick I
Upvotes: 1