Syncing your forked repository to the original repository is an important step before submitting any pull request to the original repository for the changes in your forked repository. Even if you are not going to submit a pull request to the
original repository, there are times that you want the additional features and/or bug fixes that have been done since you forked the original repository.
You could do a pull request but this adds an additional commit into your forked repository instead of making your forked repository match the original repository. In order to sync the forked repository without adding any additional commits as
part of the process you need to configure the original repository as an upstream remote, merge in the changes from the original repository and then push the merged version back to Github.
Adding Original Repo As an Upstream Repo
In order to pull the changes from the original repository into your forked version, you need to add the original git repo as an upstream repository.
Open a Command Prompt (Windows) or Terminal (Mac or Linux)
Navigate to the directory that contains your forked repository
Run the following command to list the currently configured remote repositories
Make sure that you are on your fork’s master branch
$ git checkout master
Switched to branch 'master'
Merge the changes from the upstream/master into your local master branch. This will bring your fork’s master branch into sync with the upstream repository without losing your local changes. If you have made any changes that create
a conflict, you will obviously have to resolve those before you can complete the merge.