How can I attach multiple urls to a single git remote?

Posted by deterb on Stack Overflow See other posts from Stack Overflow or by deterb
Published on 2010-04-15T21:15:59Z Indexed on 2010/04/15 22:43 UTC
Read the original article Hit count: 121

Filed under:
|

I'm currently using git on windows through a combination of msysgit and Cygwin.

I have a laptop which I move around quite a bit, so it's not on a consistent location. Unfortunately, I don't have a consistent name for it due to the computer name not being resolved on all of the locations I connect to, so I can't just use the computer name as the host for the url (e.g. git://compname/repo), so I have to use the IP address.

Is there a way I can add multiple urls to pull from for a particular remote? I've seen

git remote set-url --add [--push] <name> <newurl>

as a way to add multiple URLs to a remote, and I can see the updates in the .git/config file, but git only tries to use the first one.

Is there a way to get git to try to use all of the urls? I've tried both git fetch and git remote update, but neither tries anything after the first url.

Note that I haven't tried this on linux yet, and I can't fix the computer name resolution as this is at work.

Thanks

© Stack Overflow or respective owner

Related posts about git

Related posts about remote