ssh push to repos outside an homedirectory?

Brendan Cully brendan at kublai.com
Wed Jun 28 00:05:00 CDT 2006


On Tuesday, 27 June 2006 at 17:44, ryan king wrote:
> On Jun 27, 2006, at 12:13 AM, Bryan O'Sullivan wrote:
> >On Mon, 2006-06-26 at 22:54 -0700, ryan king wrote:
> >>It seems that the paths given when using ssh to push or pull from a
> >>repository are always relative from $HOME.
> >
> >Yep.
> >
> >>Is there no way to work
> >>with repositories outside one's home directory via ssh?
> >
> >Sure - just give an extra slash for an absolute path.
> >
> >Compare:
> >
> >ssh://hostname/path-relative-to-home
> >
> >And:
> >
> >ssh://hostname//absolute-path
> 
> Ok, good to know that works. I have to ask, though, why is this  
> different than other ssh-based things like scp and rsync with use a  
> colon like this:
> 
> scp foo hostname:/absolute_path
> 
> rsync -e ssh foo hostname:~/homedir_path

Those other formats aren't URL formats. The URL separator between the
host and the path is a single slash. The separator for the other
format is a colon. If you substitute a slash for a colon in the scp
and rsync formats, you'll end up with the equivalent path:

host:/path (absolute) -> ssh://host//path.
host:path (relative to home) -> ssh://host/path

At least for me it's fairly intuitive.


More information about the Mercurial mailing list