{"thread":{"id":"13398","subject":"Accessing a single repository with different addresses?","startedAt":"2008-05-06T16:51:13Z","lastAt":"2008-05-07T00:33:36Z","messageCount":3,"participants":["Paul Holbrook","Luciano Rocha","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"76212","messageId":"8c0610ed0805060951x70ede89bq5a93e69aece8c8c7@mail.gmail.com","threadId":"13398","inReplyTo":null,"subject":"Accessing a single repository with different addresses?","fromName":"Paul Holbrook","fromEmail":"paul.holbrook@gmail.com","sentAt":"2008-05-06T16:51:13Z","receivedAt":"2008-05-06T16:51:13Z","isPatch":false,"sender":{"key":"paul.holbrook@gmail.com","avatar":null},"body":"I have two machines at home that I've been using to play with git: a\ndesktop box and a laptop.  I set up a repository on the desktop, and\ncloned it to the laptop via ssh, but using just a local 192.168.x.x\naddress.  However, when I leave the house, I'd still like to be able\nto talk to the desktop repository, which I can still do via ssh back\nto the house - but now the address for that very same repository is\nnot a 192 address, but a DNS name.   What's the best way to handle\nthis?\n\nI'm aware that with git I don't need to have the all-the-time\nconnectivity to make it work - but when I leave the house,  there may\nbe changes on the desktop repository that I haven't yet pulled to the\nlaptop.  I still want to be able to get at those when I'm away from\nhome.\n\n-- Paul\n"},{"id":"76213","messageId":"20080506165832.GA20228@bit.office.eurotux.com","threadId":"13398","inReplyTo":"8c0610ed0805060951x70ede89bq5a93e69aece8c8c7@mail.gmail.com","subject":"Re: Accessing a single repository with different addresses?","fromName":"Luciano Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2008-05-06T16:58:32Z","receivedAt":"2008-05-06T16:58:32Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"On Tue, May 06, 2008 at 12:51:13PM -0400, Paul Holbrook wrote:\n> I have two machines at home that I've been using to play with git: a\n> desktop box and a laptop.  I set up a repository on the desktop, and\n> cloned it to the laptop via ssh, but using just a local 192.168.x.x\n> address.  However, when I leave the house, I'd still like to be able\n> to talk to the desktop repository, which I can still do via ssh back\n> to the house - but now the address for that very same repository is\n> not a 192 address, but a DNS name.   What's the best way to handle\n> this?\n\nWhy not add a local dns server and use the same dns name?\n\nOtherwise, I use a host declaration in .ssh/config, and switch as\nneeded:\n\nhost desktop\nhostname 192....\nuser ...\n\nBut that was with svn. With git you can just add a new remote with the\nother address:\ngit remote add rem host:....\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"},{"id":"76235","messageId":"m3myn354wy.fsf@localhost.localdomain","threadId":"13398","inReplyTo":"8c0610ed0805060951x70ede89bq5a93e69aece8c8c7@mail.gmail.com","subject":"Re: Accessing a single repository with different addresses?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-05-07T00:33:36Z","receivedAt":"2008-05-07T00:33:36Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Paul Holbrook\" <paul.holbrook@gmail.com> writes:\n\n> I have two machines at home that I've been using to play with git: a\n> desktop box and a laptop.  I set up a repository on the desktop, and\n> cloned it to the laptop via ssh, but using just a local 192.168.x.x\n> address.  However, when I leave the house, I'd still like to be able\n> to talk to the desktop repository, which I can still do via ssh back\n> to the house - but now the address for that very same repository is\n> not a 192 address, but a DNS name.   What's the best way to handle\n> this?\n\nIf I remember correctly git doesn't (yet?) implements multiple-URL\nfetch URIs, where first URL that works is used.\n\nIf I understand correctly you want to connect (fetch from) your\ndesktop machine from your laptop.  And this laptop is either connected\nto local network (local IP), or to Internet (DNS address).  The\nsimplest way would be to create two 'remotes', e.g. dektop-local and\ndesktop, or desktop and desktop-dns, which differn only in URL used.\n\nIn this case url.<base>.insteadOf config variable (new feature)\nwouln't help, I think....\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}