Skip to content

Instantly share code, notes, and snippets.

@hakonhagland
Last active May 5, 2017 12:43
Show Gist options
  • Save hakonhagland/77526ec6d4c7d57fe57bf90c1e71e852 to your computer and use it in GitHub Desktop.
Save hakonhagland/77526ec6d4c7d57fe57bf90c1e71e852 to your computer and use it in GitHub Desktop.
How to sync a local github fork with upstream?

Fork the repository from the GitHub UI

First fork the repository using the GitHub UI. This will create a copy of the repository under your GitHub account.

On your local machine

Run (some of) the following commands:

git clone https://github.com/my-user-name/name-of-repo.git
git remote add upstream https://github.com/orig-author-user-name/name-of-repo.git
git checkout master
git fetch upstream
git merge upstream/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment