Home > Software design >  Git URIs does not match SSH URI specification
Git URIs does not match SSH URI specification

Time:12-10

I'm studying the SSH URI specification in order to understand a bit more the URLs used to access repositories in services like Github or Bitbucket via SSH.

A typical SSH Github URL looks like this: [email protected]:myuser/myrepo.git, which I think can be decomposed in the following sections:

   scheme           authority
     |                 |
    /‾‾\/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\
    ssh://[email protected]:myuser/myrepo.git
          \_/ \________/ \_______________/
           |      |              |
          user   host           port

What I don't understand is the port section. The official general URI specification states that ports should contain only numeric values. The SSH URI scheme specification sticks to the general URI specification. And the OpenSSH config manual does the same.

Why then do they use path-like text in the port section? Is this a deviation from the standard that has been established de facto? Or am I understanding wrong this whole thing?

The only clue I have is in the LocalForward option definition in the OpenSSH config manual, which talks about a Unix domain socket path that can be used, but I'm not sure how to interpret that.

I'd appreciate if anyone can clarify this.

CodePudding user response:

Git repos can be referred to using more than just URIs. You can use paths, for instance, and you can use most (maybe all, haven't checked) things the ssh command would take. The ssh command doesn't require an ssh URI either: it already knows it's the one to interpret the resource identifier, so the restrictions imposed on uniform resource identifiers don't have any value to add here, there's nothing to be gained by following them.

The complete syntax Git accepts for a repository identifier can be found in the git clone docs, under GIT URLS.

  • Related