Sunday, 15 January 2012

git - Rebase feature branch onto another feature branch -



git - Rebase feature branch onto another feature branch -

i have 2 (private) feature branches i'm working on.

a -- b -- c <-- master \ \ \ d -- e <-- branch1 \ f -- g <-- branch2

after working on these branches little while i've discovered need changes in branch2 in branch1. i'd rebase changes in branch2 onto branch1. i'd end following:

a -- b -- c <-- master \ d -- e -- f -- g <-- branch1

i'm pretty sure need rebase sec branch onto first, i'm not exclusively sure right syntax , branch should have checked out.

will command produce desired result?

(branch1)$ git rebase --onto branch1 branch2

switch branch branch2

git checkout branch2

then rebase branch1

git rebase branch1

which leave desired result in branch2

a -- b -- c <-- master \ d -- e -- f -- g <-- branch2

you can delete branch1

git git-rebase feature-branch

No comments:

Post a Comment