Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I have a Github repository that I forked from some other project several months ago. It is now several months later and the original master repo has changed. I would like to update my repo to reflect those changes. Is this possible in the Github web interface? Or do I just need to delete the repo and re-fork it?

share|improve this question
add comment

2 Answers

up vote 15 down vote accepted

You can try and reverse how pull requests happen.

  1. Go to your fork
  2. Issue a Pull Request

    By default this will be your fork on the right (head repo) requesting to push its commits and changes to the original repo (base repo) on the left.

  3. Click the drop down for both base repo and head repo and select each other's repos.

    You want yours listed on the left (accepting changes) while the original repository is on the right (the one with changes to push). As illustrated in this image:

    fork done over itself

  4. Send the pull request

    If your fork has not had any changes, you should be able to automatically accept the merge.

If your code somehow conflicts or is not quite clean enough, then this will not work to update via the GitHub web interface and you will need grab the code and resolve any conflicts on your machine before pushing back to your fork.

share|improve this answer
    
Just adding: This is a great idea, but it might generate quite some noise for others as they will be labelled as a participant in the pull request. This isn't going to be ideal if you did not do much on your fork. Keep to using the command line as much as possible. –  Hydra Apr 3 '13 at 9:48
    
Could be problematic, could be broken now –  Eight Days of Malaise Apr 25 '13 at 4:03
add comment

It's gonna be easier.

  1. Go to the Forked Repo (yours) and just click green button.
  2. It will show you "switching base" message button. click it.
  3. Now it will automatically lead to your original repo. write some commit message and Click Create Pull Request button.
  4. Now it will lead to your forked repo automatically, click Merge pull request and Confirm merge to finish.

To make long story short, In your forked repo, just click green button, switching base button, then green button, green button, and green button.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.