Lets say we have origin
with a branch called master
which would be checked out by;
>> git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'
Now I add the remote fork
also with a branch called master
which would be checked out by;
>> git checkout -b fork-master fork/master
Switched to branch 'fork-master'
Your branch is up-to-date with 'fork/master'
This clearly knows what remote a given branch belongs to, and it even references the correct origin.
Lets say I want to push to origin I'd do this;
>> git push
Which would update origin/master with all changes (duh).
Below are 2 examples of pushes;
Example 1 **Correct!**;
>> git push fork fork-master:master
Example 2 **Fails**;
>> git push fork --all
This automatically pushes all fork
branches to origin
except for branch master
which will be rejected (in case changes where made).
What I thought example #2 would do is to push fork-master
to fork/master
, but this isn't happening.
Can I push all remote specific branches at once without having to point them to the correct remote branch name?
I'm asking because there are a lot of branches from time to time to push.