Well, thats an easy one. You want to sync your local files with the master repository which is on Github? Or on any other git platform of course,

First of all, check if you don’t have an upstream already.

git remote -v

Response from Github should be:

origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)

Next, add a upstream:

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git

Verify that this works

origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)

Now, fetch the upstream.

git fetch upstream

Next, merge it with your own fork

git merge upstream/master

Here you are, having the latest code from the original repository!