5

I am actually contributing to one of the Material Design code repository. There are a certain set of features that is planned for next release.

I have currently implemented one feature and created a PR(say PR1) and 3 commits of that feature are pushed. They are visible under that PR1. The PR1 is still in OPEN state.

I have already implemented certain other feature with 8 commits. But, when I click on the button "Create New PR", all I see is my PR1.

Here is what happens when I click on "Create New PR"-

enter image description here

Problem is-

  1. If I push the 8 commits, it goes under PR1.
  2. Unable to create a new PR for 8 commits.

How do I do it? This has been a long problem. And now I have to ask.

Why new PR? That's because, it becomes easier to review and each feature with 1 PR would be cleaner approach.

I have already been through - Question1, Question2, Question3 and few more...

With not much help. It's just that I am spamming the repo with commits & then resetting head forcefully to delete it :(

Community
  • 1
  • 1
bozzmob
  • 12,364
  • 16
  • 50
  • 73

1 Answers1

4

GitHub's pull requests can be updated by pushing new commits the existing branch. This is a deliberate design decision allowing PRs to be incrementally improved.

The solution is to push the changes you wish to be considered separately to a different branch and to open a new PR from that branch.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • Does this mean, I create a new branch on my Fork, then push it to the master of the Main Repo? Each new branch for every new feature I want to commit in parallel? – bozzmob Dec 27 '15 at 18:56
  • 1
    @bozzmob, you need to push to a new branch on GitHub. One GitHub branch per Pull Request. – ChrisGPT was on strike Dec 27 '15 at 19:05