* Accessing a single repository with different addresses?
@ 2008-05-06 16:51 Paul Holbrook
2008-05-06 16:58 ` Luciano Rocha
2008-05-07 0:33 ` Jakub Narebski
0 siblings, 2 replies; 3+ messages in thread
From: Paul Holbrook @ 2008-05-06 16:51 UTC (permalink / raw)
To: git
I have two machines at home that I've been using to play with git: a
desktop box and a laptop. I set up a repository on the desktop, and
cloned it to the laptop via ssh, but using just a local 192.168.x.x
address. However, when I leave the house, I'd still like to be able
to talk to the desktop repository, which I can still do via ssh back
to the house - but now the address for that very same repository is
not a 192 address, but a DNS name. What's the best way to handle
this?
I'm aware that with git I don't need to have the all-the-time
connectivity to make it work - but when I leave the house, there may
be changes on the desktop repository that I haven't yet pulled to the
laptop. I still want to be able to get at those when I'm away from
home.
-- Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Accessing a single repository with different addresses?
2008-05-06 16:51 Accessing a single repository with different addresses? Paul Holbrook
@ 2008-05-06 16:58 ` Luciano Rocha
2008-05-07 0:33 ` Jakub Narebski
1 sibling, 0 replies; 3+ messages in thread
From: Luciano Rocha @ 2008-05-06 16:58 UTC (permalink / raw)
To: Paul Holbrook; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 973 bytes --]
On Tue, May 06, 2008 at 12:51:13PM -0400, Paul Holbrook wrote:
> I have two machines at home that I've been using to play with git: a
> desktop box and a laptop. I set up a repository on the desktop, and
> cloned it to the laptop via ssh, but using just a local 192.168.x.x
> address. However, when I leave the house, I'd still like to be able
> to talk to the desktop repository, which I can still do via ssh back
> to the house - but now the address for that very same repository is
> not a 192 address, but a DNS name. What's the best way to handle
> this?
Why not add a local dns server and use the same dns name?
Otherwise, I use a host declaration in .ssh/config, and switch as
needed:
host desktop
hostname 192....
user ...
But that was with svn. With git you can just add a new remote with the
other address:
git remote add rem host:....
--
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Accessing a single repository with different addresses?
2008-05-06 16:51 Accessing a single repository with different addresses? Paul Holbrook
2008-05-06 16:58 ` Luciano Rocha
@ 2008-05-07 0:33 ` Jakub Narebski
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2008-05-07 0:33 UTC (permalink / raw)
To: Paul Holbrook; +Cc: git
"Paul Holbrook" <paul.holbrook@gmail.com> writes:
> I have two machines at home that I've been using to play with git: a
> desktop box and a laptop. I set up a repository on the desktop, and
> cloned it to the laptop via ssh, but using just a local 192.168.x.x
> address. However, when I leave the house, I'd still like to be able
> to talk to the desktop repository, which I can still do via ssh back
> to the house - but now the address for that very same repository is
> not a 192 address, but a DNS name. What's the best way to handle
> this?
If I remember correctly git doesn't (yet?) implements multiple-URL
fetch URIs, where first URL that works is used.
If I understand correctly you want to connect (fetch from) your
desktop machine from your laptop. And this laptop is either connected
to local network (local IP), or to Internet (DNS address). The
simplest way would be to create two 'remotes', e.g. dektop-local and
desktop, or desktop and desktop-dns, which differn only in URL used.
In this case url.<base>.insteadOf config variable (new feature)
wouln't help, I think....
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-07 0:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06 16:51 Accessing a single repository with different addresses? Paul Holbrook
2008-05-06 16:58 ` Luciano Rocha
2008-05-07 0:33 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).