Pushing from local branch "master2" to remote "origin2" creates a new remote branch "origin2/master2". How can I have it push automatically to "origin2/master"?
I have two remote tracking branches known as
origin/master
origin2/master
I have two local branches:
master
master2
Created as follows:
git checkout -b master origin/master
git checkout -b master2 origin2/master
Git tells me that it has automatically set up the local branches to track the remote branches; example:
Branch master2 set up to track remote branch master from origin2.
I've had no problem with local branch master pulling and pushing to origin/master by simply using "git pull" and "git push" while on that branch. However, when I'm on master2, "git push" creates a remote branch:
origin2/master2
My config has the following entries generated automatically:
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.master2.remote=origin2
branch.master2.merge=refs/heads/master
I'm aware that I could do this, but I'm wondering if there's a config setting to get around it:
git push origin2 master2:master
Output of git --version:
git version 1.8.2.1
Note: I've obfuscated some names here, so hopefully I didn't make any mistakes in the transpose. Please address them in the comments if you see any and I'll fix them.