Hierarchical URI support for cloning through ssh

I like to use absolute hierarchical URIs in my code, for simplicity, when possible. When cloning from a git repository using the ssh protocol, such an URI takes the form ssh://authority/path.

The git manual explicitly allows for such URIs: it says that the ssh protocol supports ~username expansion, which should permit to use ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/ instead of [user@]host.xz:path/to/repo.git/.

The problem is that GitHub seems to support only the latter form: git clone "git@github.com:oliviercailloux/testrel.git" works, but git clone "ssh://git@github.com/~/oliviercailloux/testrel.git" (or git clone "ssh://git@github.com/~git/oliviercailloux/testrel.git") fails with “fatal: remote error:
is not a valid repository name”.

Could GitHub consider supporting the ~username expansion form, for compliance with the standard ssh support in git? Has anyone found more information about this behavior in the official GitHub documentation? (I have not.)

Oops. Nevermind. I just realized that git clone "ssh://git@github.com/oliviercailloux/testrel.git" works as expected. Thank you GitHub!

1 Like

Thanks for coming back to share you got it going @oliviercailloux