Home > Blockchain >  github: creating a feature branch off a feature branch
github: creating a feature branch off a feature branch

Time:04-30

I have a feature branch, lets call feature1 that is branched off of main. I did a lot of work in feature1 that is awaiting a green light to merge in. The review was done but it is going to be merged in a few days. In the meantime, I have another task that relies on the work in feature1. If I create a feature branch, feature2, of the feature1 branch, what will that look like come time to merge? Would it show all my feature1 work as new changes in feature2 or would it not show that as new changes since feature1's work would have already been merged into main?

CodePudding user response:

If the first PR is merged before you've pushed your branch, then update the main branch and rebase your branch onto it.

If you push your branch to a PR while the first PR is still sitting in review, use the GitHub interface to set the destination of your PR's merge to the first PR's branch. This will limit the commits in the PR to yours. And here's the best part. When the first PR is merged, your PR's merge destination is reset to the main branch, automatically.

  • Related