I’m somewhat new to Git. So I’ve got the origin/master and origin/upbranch on my remote server. I’ve also got a master branch on my local machine. How do I go about setting it up so that I can push to origin/upbranch from my local machine? Also, how would I set up pulling into origin/master from origin/upbranch? I can access the remote server via static address, but have no address to access local from remote.
Also, any references you would recommend for someone learning Git?
Edit: renamed origin/upstream to origin/upbranch, since I may have misunderstood its meaning.
master (local) -> origin/upbranch (remote) -> origin/master (remote)
Is upstream a branch in this scenario? It sure looks like it. I believe that branch name is really going to confuse people.
But to answer some of the questions:
Assuming you have
master -> origin/masterandupstream -> origin/upstream. It looks like you already have your local branches tracking the remote ones.Switch to the upstream branch
You use checkout to switch to your locally tracked upstream branch. Make some changes. Commit them, them push them back to origin.
You don’t directly do this. You have to merge locally then push.
Change the local branch to upstream. Pull any changes from the remote branch. If there were merge problems you’ll have to fix + commit first before switch back to master. Switch to the master branch and merge in the changes from upstream into master. I turn off fast-forwarding so that it creates a new merge commit instead of just moving the pointer of master.
Commit the merge and then push it back to the remote server.
Confusion
If upstream is supposed to be another remote location like origin then I don’t know exactly what you are trying to do since you listed upstream as origin/upstream.
From what I have seen the name upstream would be used to name another remote location. In that case, origin would be similar to upstream. Not master to upstream. But I kept with the assumption you created 2 branches, one called master (created by default) and one called upstream and you’d like to work in them and merge upstream into master.