tags:

views:

47

answers:

2

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

A: 

I would suggest using some other remote as the sync point between your laptop and other computer(s) that you use.

e.g. github.

If you want to keep it private, try unfuddle or codaset.

hasen j
I would love to be able to do this, but I'd need to set up a git server on a Window's box on a fairly locked down IT infrastructure to pull it off. Pushing to a repository outside of the intranet is not allowed.
deterb
+1  A: 

I personally do the same thing, what I used is two remotes

origin: location of my repo when at home foriegn: location of my repo when anywhere else (my dns redirect to my house)

then i just push/pull to the appropriate remote, it's a bit messy but it works.

Aren