Git - Created a branch from previous release branch and want to copy changes to current release branch

Viewed 110

Working on a feature branch that was created from a previous release branch. The feature could not be merged into that release. Now I want to merge this feature branch into the current release branch. How do I copy all my changes (100 of files) from feature branch to current release branch.

1 Answers

You can use a git rebase --onto:

git rebase --onto newReleaseBranch $(git merge-base oldReleaseBranch featureBranch) featureBranch

It uses git merge-base to compute the base commit between the oldReleaseBranch and your feature branch.

Related