Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nepsilon/2a2c11bb77f9ad0a17f647ad9f1cb241 to your computer and use it in GitHub Desktop.
Save nepsilon/2a2c11bb77f9ad0a17f647ad9f1cb241 to your computer and use it in GitHub Desktop.
How to update a GitHub forked repository? — First published in fullweb.io issue #91

How to update a GitHub forked repository?

So you hit "Fork" and now you have this repo copy on your Github account. Here is what to do to keep it up-to-date with the original repo.

1. Add the original repo as remote, here called upstream:

git remote add upstream https://github.com/author/repo.git

2. Fetch all the branches of that upstream remote:

git fetch upstream

3. Merge an upstream branch:

git merge upstream/master

There can be variants to this process, please let me know what you think and the best practices you follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment