Recap: The original repository is referred to as upstream. Your forked copy of that repo is called origin. Your download of that fork onto your local drive is called a clone.

Prerequisites: You need to configure git to sync your fork using the git remote add command. GitHub has more details on this. Once you’ve set up the configuration, follow the steps below.

Process overview: Original repo –> Local clone –> Fork
All changes are always made on the local clone and then pushed to the fork. So to update your forked repository, you will first pull in all the changes (commits) from the original repo into your local clone, and then push those changes to your fork.

  1. In the command line, move to your repository folder: cd repositoryname.
  2. Run git fetch upstream. This fetches all the changes from the original repo.
  3. Run git checkout develop. This assumes the main branch of your repository is called develop. It may be called master, so type the appropriate command. This switches you to that branch in case you’re not there already.
  4. Run git merge upstream/develop. Again, substitute develop for whatever your main branch is. This merges all the changes from the original repo to your local clone.
  5. Run git push. This pushes the changes from your local clone to your forked repo in GitHub. If for some reason this doesn’t work, try git push origin develop (or master).
  6. Refresh your Github page and your fork should now be even (in sync) with the original repo.