How to sync a forked repository with original repository in Github ?

for creating another branch synced with original repo:

git remote add upstream https://github.com/account/repository.git
git fetch upstream
git merge upstream/master upstream
git rebase upstream/upstream

For

$ git remote add upstream https://github.com/account/repository.git
$ git fetch upstream

# then: (like "git pull" which is fetch + merge)
$ git merge upstream/master master

# or, better, replay your local work on top of the fetched branch
# like a "git pull --rebase"
$ git rebase upstream/master