On Thu, Feb 03, 2011 at 05:30:26PM -0800, anasmughal wrote:
> I was able to clone my repos using the following the following syntax:
> git clone firstname.lastname@example.org:tools.git
> However, it does not work anymore. I get the following error:
> Initialized empty Git repository in /home/t0122659/workspaceTemp/git-
> fatal: 'tools.git' does not appear to be a git repository
> fatal: The remote end hung up unexpectedly
> However, it does work, if I add "~/git/" before the name of the repo
> as follows:
> git clone email@example.com:~/git/tools.git
> Does anybody know why I need to add "~/git/" now?
I'm pretty confident an admin that takes care about gitosts instance on
that machine should know for sure.
> Would it have any ill-effects?
It shouldn't. Until someone (un)breaks it once again so that you'll have
to use another URL (which would require you to edit .git/config in your
Some more background follows.
Accessing remote Git repos over SSH, in principle, works in a quite
simple and elegant way: your git instance starts an SSH-client which
connects to the specified SSH server and starts a special server-side
git binary there (git-upload-pack) passing it the path to the repo which
is the part after the ":" in those "Git repo URLs" you're using for
cloning. That binary then performs a conversation with your local git
over the secure channel. Note here that in the case of SSH there's no
such thing as a "git deamon" on the remote side.
Now it can be seen that the remote repository path is interpreted on the
server, by the process running under a server's user account you
specified ("gitosis" in your case). Hence if you supply a relative
pathname ("foo.git") it ought to be interpreted as relative to whatever
current directogy git-upload-pack will happen to have when running.
If you supply "~/git/foo.git" it will be expanded using the usual rules
of a Unix shell -- the leading ~ bit is substituted by a full pathname
of the current user's home directory, and so it will be whatever path
the "home directory" entry for the user "gitosis" has in the /etc/passwd
To summarise: when you work with remote Git over SSH, you use real, not
virtual, paths which have sense on the remote server and are subject to
the usual Unix rules for processing such pathnames.
A corollary is that you can always use full pathnames if you know them;
this will never break until someone physically moves a repository.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at