How do I update a github fork from the original repo?

I forked a github repo.
Now I want to update my fork to the current repo version. How can I do that?

  • Simple Github commit not working (trying to add an image to my public image folder)
  • Splitting up a .NET solution/Git repo for multiple apps
  • Latest Git - No SSH option on install
  • Can not figure out how checkout works in git
  • How to make a Git merge operation ignore identical changes made to both branches?
  • git-svn: Cannot setup tracking information; starting point is not a branch
  • Difference in GIT betw. branch, clone and snapshot
  • AOSP repo sync error, bad object HEAD
  • Git GUI when on a remote server
  • Replacing git submodules with nested repos workflow
  • Untangle two lines with `git add -p`
  • What does the Refspec HEAD:refs/for/refs/heads/master generated by eGit/ZendStudio 9 mean?
  • One Solution collect form web for “How do I update a github fork from the original repo?”

    I had the same doubt and found the answer in the github help.

    git remote add upstream git://url-to-original
    git fetch upstream
    git merge upstream/master
    git push
    

    upstream is the name I gave to the original repository.

    Hope it helps.

    Git Baby is a git and github fan, let's start git clone.