Question

I forked a repository on Github, added some changes to a file, ran lint and tests, committed to my repo, initiated a pull request, conversed w/ original author, pull request accepted and combined into original repo. So far, so good.

Now, I've added changes to another file, committed (linted, tested etc.), and went to Github to initiate a new pull request, but the list of past pull requests on the repo shows 0, and when I click the "New pull request" button, it creates a pull request containing both files.

Clearly, I've missed a step between 1 and 2. Could someone clue me in to what am I missing? Do I have to re-fork the original repo?

Was it helpful?

Solution

First, always make your pull request in a branch.

Second, when you add some change (in a branch), update your master branch from the original repo:

git remote add original /url/to/upstream/repo
git fetch original
git checkout master
# make sure you don't have any work in progress
git reset --hard original/master

Then rebase your current fix branch on top of master:

git checkout fixbranch
git rebase master

You can then push that new branch to your origin (your fork):

fork

See more with this couple of tips on pull requests.

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