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