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. 😉

  • How do you pull from a different branch than the master using git?
  • Github App for Mac crashes upon opening
  • Extracting only open issues from github api without any pull request using ruby on rails
  • What is the correct VCS Username settings with Github so that “My Changes” works correctly?
  • JSPM and GIT behind Corporate proxy
  • Stage files, then remote add, then pull - and my files are gone
  • Remove a specific commit from the repository
  • Cannot push repository to GitHub “unable to read 0000000000000000000000000000000000000000”
  • 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.