Reference: https://help.github.com/articles/syncing-a-fork/
The below is a summary of how you are able to synchronize your forked repository in GitHub with the original repository you originally forked from.
-
Clone your forked repo into your workspace and
cd
into it.git clone [email protected]:YOUR_USERNAME/YOUR_FORK.git cd YOUR_FORK
-
Add the upstream URL.
git remote -v git remote add upstream [email protected]:ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git git remote -v
-
Fetch the branches and their respective commits from the upstream repository. Commits to
master
will be stored in a local branch,upstream/master
.git fetch upstream
-
Check out your fork's local
master
branchgit checkout master
-
Merge the changes from
upstream/master
into your localmaster
branch.git merge upstream/master
-
If you had any local changes, complete those changes and commit them to
master
. -
Push the updates to your forked repository.
git push origin master