To create a git repository and access to it via ssh:

$ ssh your.host
$ mkdir my-new-repo
$ cd my-new-repo
$ git --bare init

To access your repo (clone it):

$ git clone ssh://[email protected]:2222/~user/my-new-repo