Reputation: 291
I have branch A branched out from a release branch. I made some commits on branch A. Now I want to bring these commits (only these commits) to another branch based out of master.
master and this branch also have different commits made by others. How is it possible to just bring my commits to this new branch? If I merge the branches those changes will also come in right? Can someone help me how i can achieve this?
Upvotes: 1
Views: 43
Reputation: 1329082
That would be a git rebase --onto
:
git rebase --onto anotherBranch $(git merge-base release A) A
# or
git switch A
git rebase --onto anotherBranch $(git merge-base --fork-point release) A
That will move any commit made after merge-base release A
and A
to anotherBranch
.
(Using merge-base --fork-point release
is also possible)
Upvotes: 2