4

I have 3 branches

develop, master and a feature branch which is made with git flow feature start.

Now I want to make the commits which are made from the feature to be merged into a separate hotfix so I can merge it into the master without merging the developer branch into the master how can I do that?

To clerify

develop has 100+ commits which are made for a separate release,

I made branch out of the dev, and want to make it into a separate hotfix.

The problem is a hotix is a master originating branch, so if I do git merge feature git will merge ALL of the developer commits with the few commits I amde on the feature.

The question is. how to cherry pick the feature?

EDIT:

@Pigueiras

I am more like in this situation, I draw a diagram. enter image description here

I need to ONLY transfer the red noted commits from the feature to the hotfix.

Lain
  • 2,166
  • 4
  • 23
  • 47
Sangoku
  • 1,588
  • 2
  • 21
  • 50
  • If you want to put more info in the question, edit the question with the stuff, don't put another answer :). Also the references to other people with @ doesn't work if they are not a comment :(, that's why I didn't know that you were asking me more things. Is it OK now with my answer? – Pigueiras Nov 06 '13 at 12:52

1 Answers1

7

It seems like you want to use a rebase --onto. In the git documentation you have an example about how to move the parent of the branch that you are using.

In your case, you should do:

git rebase --onto hotfix develop feature/branch

Also related: Setting git parent pointer to a different parent.

Be aware that this is a rebase, so don't do that if the commits are published for more developers.

Community
  • 1
  • 1
Pigueiras
  • 18,778
  • 10
  • 64
  • 87