4
I have a branch derived from master
, development
, that never comes back to master
. All the branchs of features
are derivatives of development
, but after tested and validated, are combined both with the development
when with the master
. I can’t match directly to development
with the master
because I have features
there that are not yet to be merged with the master
.
I wonder if there’s any way to change the base branch of a feature
without causing conflicts in the files that were not changed only in this feature
.
Today I can do the git cherry-pick <commit>
but I believe that on a tree with many commits is a bit of a hassle.
The design of my flows branchs
is more or less the following:
.-[feature1]---o---o---o-.
/ \
/ .-[feature2]---o-. \
/ / \ \
.-[development]---´---´--------------------+-------+
/ \ \
[master]---´----------------------------------------------+-------+---...
o - commits + - merge
In the above drawing, today, what would be the merge
I’m doing like cherry-pick
.
I don’t think that’s an ideal answer, but
git cherry-pick A^..B
makes the Cherry-pick of all commits between A to B (including commits A and B themselves)– hkotsubo
@hkotsubo but the problem is that it will catch from all
branchs
who havecommit
at that time, no?– Sorack
If it’s the way it is in the picture, I don’t think so. If all commits between A and B belong to the Feature1 branch, you’ll only get these.
– hkotsubo
@hkotsubo then, but not the case, because the development of the
feature1
andfeature2
occur in parallel. It occurred to me now that maybe I can givesquash
in thepull request
by putting indevelopment
and then do thecherry-pick
only ofmerge
. I don’t know if I can do this– Sorack
Yeah, I don’t know either. I usually use git in a more "basic" way (branch -> push -> pull request), once in a while I do a Cherry-pick or rebase here and there, but that’s it. I do not do many "juggling", let alone suggest that others do it. Sorry I can not help more...
– hkotsubo