Update a github fork

Github forked repositories can be updated from Github or terminal.

To update from Github, you can create a “Pull Request” from the original repository to yours.

For updating using the terminal, add the original repo as a remote upstream to sync from.

# check that there is no remote upstream repo and add one
git remote -v
git remote add upstream https://github.com/Original/OriginalRepo.git

# verify that upstream has been added and fetch branches and commits into upstream/master
git remote -v
git fetch upstream

# checkout fork's master branch and do a merge of upstream/master into it
git checkout master
git merge upstream/master

# push the changes to have your master branch
git push