2

I forked a github project and worked on some queries and sent pull requests. The problem is that when I sent pull requests for different tickets, if the previous pull request has not merged, the later pull request is added to the same pull request as a commit.

How can I send a different pull request for the next fix?

Aruna Karunarathna
  • 981
  • 2
  • 23
  • 55
  • [Related/duplicate](http://stackoverflow.com/a/15055649/761202) - see in particular "A note on branches". – AD7six Aug 03 '14 at 14:57

2 Answers2

2

Use branches for each PR / Fix.

For example:

git clone <somerepo> somewhere
cd somewhere
git checkout -b fix-1
# ... code code code
git commit -am 'Great commit message'
git push -u origin fix-1

And submit a PR from branch fix-1 to master.

Before you start working on the next fix switch back to master.

git checkout master
git checkout -b fix-2
# repeat!
stderr
  • 8,567
  • 1
  • 34
  • 50
1

A pull request is a request to merge one of your branches into the original branch in the original repo.

If you want to make multiple independent pull requests, you need to start each one in a separate branch. (you should reset each branch to the upstream master)

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964