I have two remotes, public
and private
, and two branches, master
and learn
.
When I'm on master
I'd like git push
to push to both public
and private
; and when I'm on learn
I'd like git push
to push to just private
.
I've tried git push --all private -u
, but this doesn't seem to have any effect.
In detail, I've done:
$ git remote remove public
$ git remote remove private
$ git remote add public https://github.com/.../A.git
$ git remote add private https://github.com/.../B.git
$ git push -u public master
Branch master set up to track remote branch master from public.
$ git push --all private -u
Branch learn set up to track remote branch learn from private.
Branch master set up to track remote branch master from private.
Running git branch -avv
(after manually pushing everything to each branch) gives:
* learn 6489f4c [private/learn] ...
master 6489f4c [private/master] ...
remotes/private/learn 6489f4c ...
remotes/private/master 6489f4c ...
remotes/public/master 6489f4c ...