rubo77
rubo77

Reputation: 20845

How can I make separate pull-requests for each commit in GitHub?

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

Upvotes: 4

Views: 3200

Answers (3)

Stuart Cardall
Stuart Cardall

Reputation: 2447

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

Upvotes: 1

rubo77
rubo77

Reputation: 20845

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

Upvotes: 2

Chris Mukherjee
Chris Mukherjee

Reputation: 841

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.

Upvotes: 0

Related Questions