23

I've used other revision control systems before but have little experience with git and github.

I wanted to contribute to a project, so I forked it on github, fetched a local copy of my fork, edited it, committed it, pushed the change back to my github fork, and opened a pull request for the original upstream author to look at. That all seems fine. The author said he'll get around to using it in a bit.

But now I want to address a second issue of the project with a second pull request. But everything I commit and push ends up being appended to that first pull request. What I want to do is make a new second pull request for the subsequent changes, while the first pull request is still pending and not merged in to the upstream yet.

What steps do I need to run to do that? I'm using git-bash.

user3496878
  • 247
  • 2
  • 3
  • possible duplicate of [How to make individual pull requests vs "stacking" them on top of each other in Github?](http://stackoverflow.com/questions/18160521/how-to-make-individual-pull-requests-vs-stacking-them-on-top-of-each-other-in) – random May 11 '14 at 03:36
  • In short, create a new branch for a new pull request – random May 11 '14 at 03:36

1 Answers1

4

You have to think in your developments as separated features that aren't related. Your second feature should use a new branch/fork which should be created from the original/currentVersion project, like the first time.

mayo
  • 3,845
  • 1
  • 32
  • 42
  • 2
    What if the first pull request had a mistake. Do I have to make a new branch simply because I had a bad or mistaken pull request? – Goose Mar 02 '16 at 19:39
  • 2
    If the first pr was merged to the original/currentVersion branch, I suggest you make another branch (is like any other bug and fix flow). If not, you can work on the same branch (the first pullRequest branch), commit the fix and the pr will be updated with your changes. – mayo Mar 02 '16 at 21:13
  • 1
    What? Create a whole new branch just because I added two comments into example configs — are you serious? – Hi-Angel Sep 01 '16 at 15:25
  • haha, good point! well, I guess that it's a good example to apply the "common sense" rule! I would say that if you are not modifying logic you should skip the pull request. – mayo Jun 28 '18 at 18:44