Mouson Chen
Mouson Chen

Reputation: 1224

Rebase feature branch onto develop when feature with subfeature

I have a feature branches that I'm working on.

d1 -- d2 -- d3 -- d4 -- d5 -- d6 -- d7 -- d8                   <- develop
       |
       \ -- f1 -- -- -- -- -- f2 -- f3 -- -- -- -- -- f4 --    <- feature
             |                |      |                |
             \ -- s1 -- s2 -- /      \ -- x1 -- x2 -- /

I want to rebase feature to develop with sub feature s1, look like:

...etc,.-- d7 -- d8                                                       <- develop
                  |
                  \ -- f1 -- -- -- -- -- f2 -- f3 -- -- -- -- -- f4 --    <- feature
                        |                |      |                |
                        \ -- s1 -- s2 -- /      \ -- x1 -- x2 -- /

which command produce the desired result ?

(feature)$ git rebase develop

I try git rebase develop, but feature and sub feature branch become a line :

...etc,.-- d7 -- d8                                                       <- develop
                  |
                  \ -- f1 -- s1 -- s2 -- f2 -- f3 -- x1 -- x2 -- f4 --    <- feature

Upvotes: 0

Views: 234

Answers (1)

Jepessen
Jepessen

Reputation: 12415

Try git rebase --preserve-merges develop

Upvotes: 1

Related Questions