Say I have 3 branches: master
, release
and myfeature
. Is it possible to create 2 pull requests from myfeature
to both master
and release
without creating another branch?
Why might I want this?
Say master is the current latest, and release was a year ago. When a bug is fixed a PR is created against release, now this fix also needs to go into master, a cherry pick is perfect, but that will need a new branch as far as I know. I just wish it was possible to use the same original fix branch to merge into both (as long as master is still compatible).
There can be only one open PR from a given branch.
It's a good practice to create a new branch for every new bit of work you start doing, even if it's a very small one. It's especially useful to create a new branch for every new feature you start working on. Branches are of course disposable, you can always remove them.
Stacked Pull Requests is a workflow strategy for splitting up code changes into more reviewable units. Instead of having a single large pull request, a changeset is submitted as a series of PRs and branches, each as a patch to the previous branch. In effect, this treats changesets as a queue to be merged to master.
You probably want to think a little more about your branches, and why you have them.
There's nothing to stop you from creating pull requests between your branches. I assume you're creating pull requests so that you can have conversations about those changes. I guess my question is "how will the conversation be different in these two cases?"
It feels, to me, like you may want to use a PR to have a conversation as you merge changes from myfeature
to master
, but once that conversation has happened the merge from master
to release
doesn't need to occur...it's just a merge.
I wonder if you should be using tags, rather than branches, in place of release
. You may also want to check out some of the following resources to define how you're going to use git to manage this sort of thing:
GitHub's docs on Pull Requests
Altasian's view on git workflows
The original post on git-flow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With