Question

I made two changes on a project in GitHub (two commits). How can I create two different pull requests from my changes?

I only found a way to create one big pull request that includes all my changes: https://github.com/tcatm/ffmap-d3/pull/22

Was it helpful?

Solution

You can easily solve this with the SmartGit/hg GUI:

  • open the log of the master branch
  • right-click on the first revision from the time, you forked the main project and create a new branch from there
  • switch into that branch in the left bottom corner with right-click
  • cherry-pick the revisions you want to make a separate pull request and commit them as one commit
  • push your new branch up on GitHub
  • there you can create a pull request from just that branch

for the second pull request, you create a new branch and do the same with it

OTHER TIPS

Here are some screenshots taken from the Mac OSX version of the GitHub desktop program.

Here I am making the first commit, but you can see both changes have been made prior to the commit: Commit #1

Here I am making the second commit: Commit #2

Here you can see that each commit was accepted individually: Overview

  • Note: Some names have been blanked out for privacy.

Assuming that the Windows version of GitHub has the same options, I would download the desktop program and try that.

Create a new branch:

git checkout master
git checkout -b mybranch
... make changes ...
git add myfile
git commit
git push -u origin mybranch

Then create a pull request and change the last compare button on github to mybranch

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top