Scott Stafford
Scott Stafford

Reputation: 44786

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. ;)

Upvotes: 0

Views: 1164

Answers (1)

twalberg
twalberg

Reputation: 62399

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.

Upvotes: 2

Related Questions