I forked a project. I worked on it for a bit.
I now have ten different commits, each of which is independent of the other commits. I'd like to send each individual commit as a separate pull request, to let the maintainer of the upstream choose which ones he/she wants.
I can't find an easy way to do this.
The "easiest" I can find is to create ten separate branches, and cherry-pick each of the ten separate commits into those branches, and then send a pull request from each.
That's ... not sane! (See for example how to divide one pull request into two different pull request on github )
The underlying git request-pull
function supports this workflow, so is the problem here that GitHub just doesn't have a good interface to this? Am I doomed to create ten branches?
In the "Branch" menu, choose the branch that contains your commits. Above the list of files, click Pull request. Use the base branch dropdown menu to select the branch you'd like to merge your changes into, then use the compare branch drop-down menu to choose the topic branch you made your changes in.
A pull will pull all the commits, including their dependencies - it won't cherry-pick individual commits. So if you want to request that only your commits be pulled, and there are other people's commits in the same branch, you have to first separate your commits into a different branch. Yes, it will.
There can be only one open PR from a given branch.
Have one commit per logical change and one major feature per pull request. When you submit a pull request, all the commits associated with that pull request should be related to the same major feature.
GitHub's Pull Requests are designed to be per-branch, not per-commit. This is deliberate:
After your pull request is sent, any new commits pushed to your branch will automatically be added to the pull request. This is especially useful if you need to make more changes.
If you want to send ten Pull Requests in GitHub you'll have to do it using ten branches. The only exception would be if you wait for each Pull Request to be merged before submitting the next one.
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