0

I've just recently started working with git and github.

I forked a project, contributed to it and created a pull request. That pull request was merged.

In the mean time, the project I forked has had new changes pulled into it. Now I want to grab those changes so that my forked project is identical to the project head.

How do I do it? Following this link Syncing a fork Didn't work.

$ git fetch upstream
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
hookenz
  • 36,432
  • 45
  • 177
  • 286

3 Answers3

1

You didn't add a remote called upstream. You can add it by executing git remote add upstream <git-repository-url>. When you are at the project page on GitHub you can find the git-repository-url on the right, there it is called clone URL. After you added the upstream remote you can execute the steps you originally found. When updating a fork, a rebase could make the history cleaner. Check this anser to see how that is done.

Community
  • 1
  • 1
Dennis van der Schagt
  • 2,404
  • 2
  • 27
  • 33
0

Try git pull. Or git pull origin master if you are on the master branch.

Robert Lee
  • 439
  • 4
  • 11
  • Yeah that was useless... it said it was up to date. But on github it says it's 5 commits behind even after I did a push. – hookenz Nov 13 '14 at 20:20
0

From https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/ try doing this :

git pull https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git BRANCH_NAME
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
  • I believe that should work but it I think it's better (more efficient/clear) to add a remote, called something like `upstream`, and then fetch from there. – Dennis van der Schagt Nov 13 '14 at 20:28