4 ms·
A simpler way is just define two remotes to push and pull from in a single namespace say origin. If one is up you'll have no real problem. No need for code path
by mitchty 12y ago
A simpler way is just define two remotes to push and pull from in a single namespace say origin. If one is up you'll have no real problem. No need for code paths to test or having fallback stuff either. Just make git use both remotes. Linus uses git that way.
http://marc.info/?l=git&m=116231242118202&w=2 http://marc.info/?l=git&m=116231242118202&w=2
- oelmekki 12y agoNice, I didn't know one could have multiple urls for the same remote. This post does not specify what happen on a `git fetch all`. I suppose it takes the first one, and you have to specify other remote entries if you want to pinpoint the remote repos to use ? Note that the deploy I mention will do a fetch, so this solution does not replace the fallback variable.
- mitchty 12y agoNo idea on git fetch all, but for a normal fetch it just iterates if the first one say fails it goes to number 2 in the list etc.. Past that I've not used it that often outside of having a cheap cluster solution in a way. Try it out and let me know!