Pull new updates from original GitHub repository into forked GitHub repository

Viewed 283983

I forked someone's repository on GitHub and would like to update my version with commits and updates made in the original repository. These were made after I forked my copy.

How can I pull in the changes that were made in the origin and incorporate them into my repository?

8 Answers

If you want to do it without cli, you can do it fully on the Github website.

  1. Go to your fork repository.
  2. Click on New pull request.
  3. Make sure to set your fork as the base repository, and the original (upstream) repository as a head repository. Usually, you only want to sync the master branch.
  4. Create a new pull request.
  5. Select the arrow to the right of the merging button, and make sure choose to rebase instead of merge. Then click the button. This way, it will not produce unnecessary merge commit.
  6. Done.

If there is nothing to lose you could also just delete your fork just go to settings... go to danger zone section below and click delete repository. It will ask you to input the repository name and your password after. After that you just fork the original again.

To automatically sync your forked repository with the parent repository, you could use the Pull App on GitHub.

Refer to the Readme for more details.

For advanced setup where you want to preserve your changes done to the forked repository, refer to my answer on a similar question here.

Related