I'm new to posting/commenting on StackOverflow so I couldn't comment in this link: Git - Pushing code to two remotes
I noticed that the order of the push URLs matter. In the case of:
$ git remote show origin
* remote origin
Fetch URL: git://original/repo.git
Push URL: git://another/repo.git
Push URL: git://original/repo.git
It will push to another
first. But if that another
is inaccessible, the push will fail and git won't bother pushing to original
. My workaround was to switch the Push URL manually in .git/config
so that original
comes first (assuming more accessible).
Is this scheme reliable for working with multiple branches? I'm using original
as my main for fetch/pull, and another
for backup. Or will I be better off with using alternative methods (i.e. two remotes with two pushes)?