Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to update a GitHub forked repository? — First published in 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

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