I have a Git branch for each feature. However, sometimes, when developing in branch A
, I would like to test how A
would behave if B
was applied also.
At the moment, I use this:
git checkout A
git branch base
git merge B
git reset --mixed base
git branch -D base
Is there a shorter way to do this?
Additionally: what if A
and B
do not share the same ancestor?
o -- o -- o [A]
\-- x -- o [v1_0]
\ -- b1 -- b2 -- o [B]
How could I do something like this more easily?
git checkout A
git branch ABase
git cherry-pick v1_0..B // only applying b1,b2 not x
git reset --mixed ABase
git branch -D ABase
git merge v1_0..B
? Don't you meangit cherry-pick v1_0..B
instead? – Interinsurance