How do I add a local upstream to git?

I have two GitHub-hosted clones set up. One is a readonly clone of the repository, the other is a read/write clone of my fork. I have changes I intend to submit a pull request for on the fork clone. But to test, I want to merge it locally into my readonly clone, which has changes I did a while back that aren’t fit for consumption.

How do I set up one clone to be able to merge from the other clone’s feature branch? I think it’s simply setting up an upstream, but using git is probably the hardest thing I’ve ever tried to do, and so I reach out to you for help. I’m sure there are 12 ways to do it, all equally bizarre. 😉

  • Move git remote head to earlier commit
  • Merging commits together in a branch
  • Git: updating remote branch information
  • Don't move project outside workspace while creating a EGit repo in Eclipse
  • SourceTree git stash missing
  • Git - dealing with mixed encoding filenames
  • How to make git push run faster
  • git stash drop oldest stashes ( say oldest 5 stashes)
  • In a cycle for git add / rebase --continue
  • Does a folder in my user site conflict with a project site?
  • How to create a new GitHub repo from an existing one?
  • Is it possible to fork a github repo that I already own and then save it as a new repository?
  • One Solution collect form web for “How do I add a local upstream to git?”

    I don’t know about 12 ways to do it, but the easiest would be git remote add other /path/to/other/repository. Then you can git fetch other and/or git push other. There are some other things you can do to set up specific branches you want to push/fetch from, but adding another remote (even though it’s not remote) is the way to start.

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