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 S
I do this, not exactly what you asked, but close and with prettier links:
create a path like
/srv/git
where you place you git projects
next make a symbolic link to home:
ln -s /srv/git $HOME
next you can have shorter links
git clone user@server:git/myproject.git
if you have a single project you can get rid of the git/ part in the url
ln -s /srv/git/myproject.git $HOME
next
git clone user@server:myproject.git
will work. Of course the .git at the end of the URL comes only from creating the bare with .git in the name. Note also that ssh:// part is not needed: the @ implies it is an ssh URL for git.
Updated: let me add a sidenote: following the most recent Filesystem Hierarchy Standard I use now /srv/git as repository location.