How to open multiple pull requests on GitHub
Solution 1:
Pull requests are based on a branch.
The only way to open up a pull request for multiple commits is:
- Isolate them into their own branch.
- Open the pull requests from there.
Solution 2:
The easiest way I've found to do this is with the hub command (https://github.com/defunkt/hub).
From your topic branch ("feature" in this example) that you want to create a pull request for, you can just run:
git pull-request
(remember to push your branch first!)
And it will open a new pull request on GitHub for "YOUR_USER:feature".
If you've already created an issue on GitHub, you can even attach a pull request to that existing issue (something you can't do from the web UI):
$ git pull-request -i 123
[ attached pull request to issue #123 ]
Solution 3:
You can create Pull Request(PR), by making separate branches for your work.
Example:
-
You checkout from a branch master into a branch work-1.
-
You make some commits in branch work-1 as work-1-commit-1 and work-1-commit-2
-
Now you create a PR from work-1 to master. Your code can be reviewed by seeing files changed from PR.
-
Now, for further work you will checkout from branch work-1 into new branch work-2
-
You make some commits in branch work-2 as work-2-commit-1 and work-2-commit-2
-
Now you create a PR from work-2 to work-1. Your code can be reviewed by seeing files changed from PR.
Here the files changes will only have the new code you write after work-1-commit-2.