example.
on the server (accessible from the outside by the name server.tld ) you create a bare repository in the repo directory in the user home directory on behalf of this user:
$ git init --bare ~/repo
from another machine you clone this repository:
$ git clone ssh://user@server.tld/~user/repo
here ~user/repo is the path to the repository on the server, the string ~user means the home directory of the user user .
another way to specify url :
$ git clone user@server.tld:repo
A more convenient means of creating, managing, and using a set of git repositories seems to me to use a set of gitolite scripts. the package of the same name is present in most popular distributions of the gnu / linux operating system.