I have a workflow that needs some assistance. I usually create a branch and open a pull request on github (standard procedure). However, sometimes I want to create another PR that depends on the PR from earlier that is still open. I want reviews on the second PR while the first PR is still open.
To do that, I first create another branch (off of the earlier branch) and open a PR that requests changes into the first branch. Meanwhile, if I have changes for the first branch (addressing the first PR's comments), I commit them into the first branch, and then rebase them into the second branch. I then force push the first branch and second branch to their remotes.
However, the problem is that the second PR sometimes shows changes from the first branch. It's a linear history and I think github is confused. I try this weird thing where I change the branch in the second PR to some other common ancestor branch, and then change it back to the first branch, and suddenly the changes from the first branch that shouldn't have appeared disappear.
Is there a way to prevent this problem from happening? I never want the first PR's changes to appear in the second PR (as commits). I just want the second PR to look like it is committing changes into the first PR.
After the first PR is merged, I then usually go into the second branch and rebase --onto our_main_branch
and update the second PR in github to request merging changes into our_main_branch
. I welcome any comments on a better workflow as well.