Sometimes it happens: You have to work on a new feature, but that feature is depending on another feature that isn’t merged yet. Especially when trying to keep your branches small and you’re not doing trunk-based development, this may happen.
Luckily, Bitbucket makes our life a lot easier. Say you create a new feature-branch-2
based off of feature-branch-1
, when you create the pull request, instead of targetting main
which will cause your diff to contain the changes of both branches, you can set the target of your PR to be feature-branch-1
. Now your diff will only contain the changes in feature-branch-2
, which makes it a lot easier to review.
Now, when the feature-branch-1
PR is reviewed and ready to be merged, you don’t really have to do anything to the feature-branch-2
PR, as long as you keep this checkbox checked that is checked by default:
On merging, Bitbucket will now automatically re-target the feature-branch-2
PR to the main
branch.
Leave a Reply