I have set up a simple server with a single git account to which I connect using SSH.
I try to clone a repository located in its home directory (/srv/git) with git clone ssh://git@server:port/repository. It won’t work unless I prepend ~/ to the repository name.
If I don’t prepend it, it will work only if the repository is located at the root of the filesystem.
Somehow, git is not realizing its own user directory. How can I change this “odd” behaviour so it works as expected? (at least for me)
You have to provide an absolute path or a path using the
~to indicate the home directory. Quoting fromgit-clone(1):An alternate solution would be using something such as gitolite. Then you will be able to use repository URLs such as
sshuser@host:reponame