I'm running a git repository server accessible via SSH, on a custom port (let's say 12345). I have found that in this case the repository URLs need to be specified using SSH syntax:
git clone ssh://login@server.com:12345/absolute/path/to/repository
I'd like to setup it in such a way that it would be possible for users to clone repositories without specifying the absolute path.
git clone ssh://login@server.com:12345/repository.git
I have researched the topic and found the following options:
- Remove the custom port from the URL and make the users add it to their
~/.ssh/config
file (a last-resort workaround rather than a solution). - Drop SSH and use
git-daemon
and specify its--base-path
parameter (still a workaround...) - Use an utility like
gitosis
orgitolite
- but wouldn't it be an overkill to use it for this purpose only? Gitosis is discontinued, gitolite is a quite huge piece of software...
All I want is a "prettier" SSH URL with custom port (so I can distribute the whole git clone
command and require nothing more from the remote user). Which one of the above solutions would be the most viable in my case?