What does the name after the colon in GItHub ssh address mean?












0














For example,



git@github.com:JohnCoates/Aerial.git


in this command, I think



git: username in GitHub Unix server
github.com: host name
/Aerial.git: directory


.



So, what is :JohnCoates? Generally, there would be a port number, but JohnCoatesdoesn't look like a port number.



P.S.
I found this answer and by reading this, JohnCoates looks like the part of the directory.
But why isn't there /?
https://stackoverflow.com/questions/5279624/whats-the-purpose-of-the-colon-in-this-git-repository-url










share|improve this question





























    0














    For example,



    git@github.com:JohnCoates/Aerial.git


    in this command, I think



    git: username in GitHub Unix server
    github.com: host name
    /Aerial.git: directory


    .



    So, what is :JohnCoates? Generally, there would be a port number, but JohnCoatesdoesn't look like a port number.



    P.S.
    I found this answer and by reading this, JohnCoates looks like the part of the directory.
    But why isn't there /?
    https://stackoverflow.com/questions/5279624/whats-the-purpose-of-the-colon-in-this-git-repository-url










    share|improve this question



























      0












      0








      0







      For example,



      git@github.com:JohnCoates/Aerial.git


      in this command, I think



      git: username in GitHub Unix server
      github.com: host name
      /Aerial.git: directory


      .



      So, what is :JohnCoates? Generally, there would be a port number, but JohnCoatesdoesn't look like a port number.



      P.S.
      I found this answer and by reading this, JohnCoates looks like the part of the directory.
      But why isn't there /?
      https://stackoverflow.com/questions/5279624/whats-the-purpose-of-the-colon-in-this-git-repository-url










      share|improve this question















      For example,



      git@github.com:JohnCoates/Aerial.git


      in this command, I think



      git: username in GitHub Unix server
      github.com: host name
      /Aerial.git: directory


      .



      So, what is :JohnCoates? Generally, there would be a port number, but JohnCoatesdoesn't look like a port number.



      P.S.
      I found this answer and by reading this, JohnCoates looks like the part of the directory.
      But why isn't there /?
      https://stackoverflow.com/questions/5279624/whats-the-purpose-of-the-colon-in-this-git-repository-url







      ssh git github






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 '18 at 3:47

























      asked Nov 23 '18 at 3:41









      Hidehiro NAGAOKA

      33




      33






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You aren't looking at an URL here – you are looking at a rsh/rcp-style address, similar to what's still being used by scp and rsync these days. So the rsh syntax is different from URLs: everything after the colon is the directory path, and there is no provision for port specification.



          You are still correct that the git in git@... is a Unix username on the server, and github.com is the hostname. I think this is probably something that URLs inherited from rsh-style addresses.



          (The original rsh had an unusual these days security model and did not allow using a different port; ssh uses a separate command-line option -p to change it if needed.)



          So the entire JohnCoates/Aerial.git is a directory path. Why does it not start with a /? First of all, again, because this isn't an URL-format address and uses : as the field separator. Second, because the server does not require the leading slash in paths.





          • On plain Unix SSH servers:



            The path doesn't need to start with / when it's relative to the current directory. In Git addresses, that means it's relative to the user's home directory.



            Because RSH/SSH are meant for logging into a system account, they have a concept of "home directory" exactly like local logins do. When you log in to the system, your commands start at /home/UserName (until you cd elsewhere), so running ls Projects is the same as ls /home/UserName/Projects.



            All software which uses SSH transport – including SFTP, Git, and Rsync – can also use this feature. For example, if you tried to clone from a simple SSH server, using the address fred@example.com:Projects/App.git, that's the same as cloning fred@example.com:/home/fred/Projects/App.git.



            (As you can see, absolute paths do start with a / – but they are still separated using a : in rcp addresses.)




          • On GitHub, GitLab, and other custom systems:



            GitHub runs a custom git which does not directly map repository names to filesystem paths. Instead, it manually parses the received path against a regex such as ^/?(.+)/(.+).git$ and looks up the result in a SQL database.



            So a GitHub "path" is really just a custom string that doesn't need to follow any of the usual path rules. As one example of that, GitHub accepts paths both with and without the leading slash, as you'll see in the URL examples below.






          That being said, Git also supports URL-style addresses. Your example can also be written as:



          ssh://git@github.com/JohnCoates/Aerial.git


          Now the path is /JohnCoates/Aerial.git as you'd expect (in URLs it is always absolute).



          Note that although the path is different, GitHub still accepts it the same way – but a standard Unix server wouldn't. (It would require the full path, with home directory, to be specified.) To continue my earlier example:



          fred@example.com:/home/fred/Projects/App.git

          ssh://fred@example.com/home/fred/Projects/App.git





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377716%2fwhat-does-the-name-after-the-colon-in-github-ssh-address-mean%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You aren't looking at an URL here – you are looking at a rsh/rcp-style address, similar to what's still being used by scp and rsync these days. So the rsh syntax is different from URLs: everything after the colon is the directory path, and there is no provision for port specification.



            You are still correct that the git in git@... is a Unix username on the server, and github.com is the hostname. I think this is probably something that URLs inherited from rsh-style addresses.



            (The original rsh had an unusual these days security model and did not allow using a different port; ssh uses a separate command-line option -p to change it if needed.)



            So the entire JohnCoates/Aerial.git is a directory path. Why does it not start with a /? First of all, again, because this isn't an URL-format address and uses : as the field separator. Second, because the server does not require the leading slash in paths.





            • On plain Unix SSH servers:



              The path doesn't need to start with / when it's relative to the current directory. In Git addresses, that means it's relative to the user's home directory.



              Because RSH/SSH are meant for logging into a system account, they have a concept of "home directory" exactly like local logins do. When you log in to the system, your commands start at /home/UserName (until you cd elsewhere), so running ls Projects is the same as ls /home/UserName/Projects.



              All software which uses SSH transport – including SFTP, Git, and Rsync – can also use this feature. For example, if you tried to clone from a simple SSH server, using the address fred@example.com:Projects/App.git, that's the same as cloning fred@example.com:/home/fred/Projects/App.git.



              (As you can see, absolute paths do start with a / – but they are still separated using a : in rcp addresses.)




            • On GitHub, GitLab, and other custom systems:



              GitHub runs a custom git which does not directly map repository names to filesystem paths. Instead, it manually parses the received path against a regex such as ^/?(.+)/(.+).git$ and looks up the result in a SQL database.



              So a GitHub "path" is really just a custom string that doesn't need to follow any of the usual path rules. As one example of that, GitHub accepts paths both with and without the leading slash, as you'll see in the URL examples below.






            That being said, Git also supports URL-style addresses. Your example can also be written as:



            ssh://git@github.com/JohnCoates/Aerial.git


            Now the path is /JohnCoates/Aerial.git as you'd expect (in URLs it is always absolute).



            Note that although the path is different, GitHub still accepts it the same way – but a standard Unix server wouldn't. (It would require the full path, with home directory, to be specified.) To continue my earlier example:



            fred@example.com:/home/fred/Projects/App.git

            ssh://fred@example.com/home/fred/Projects/App.git





            share|improve this answer




























              0














              You aren't looking at an URL here – you are looking at a rsh/rcp-style address, similar to what's still being used by scp and rsync these days. So the rsh syntax is different from URLs: everything after the colon is the directory path, and there is no provision for port specification.



              You are still correct that the git in git@... is a Unix username on the server, and github.com is the hostname. I think this is probably something that URLs inherited from rsh-style addresses.



              (The original rsh had an unusual these days security model and did not allow using a different port; ssh uses a separate command-line option -p to change it if needed.)



              So the entire JohnCoates/Aerial.git is a directory path. Why does it not start with a /? First of all, again, because this isn't an URL-format address and uses : as the field separator. Second, because the server does not require the leading slash in paths.





              • On plain Unix SSH servers:



                The path doesn't need to start with / when it's relative to the current directory. In Git addresses, that means it's relative to the user's home directory.



                Because RSH/SSH are meant for logging into a system account, they have a concept of "home directory" exactly like local logins do. When you log in to the system, your commands start at /home/UserName (until you cd elsewhere), so running ls Projects is the same as ls /home/UserName/Projects.



                All software which uses SSH transport – including SFTP, Git, and Rsync – can also use this feature. For example, if you tried to clone from a simple SSH server, using the address fred@example.com:Projects/App.git, that's the same as cloning fred@example.com:/home/fred/Projects/App.git.



                (As you can see, absolute paths do start with a / – but they are still separated using a : in rcp addresses.)




              • On GitHub, GitLab, and other custom systems:



                GitHub runs a custom git which does not directly map repository names to filesystem paths. Instead, it manually parses the received path against a regex such as ^/?(.+)/(.+).git$ and looks up the result in a SQL database.



                So a GitHub "path" is really just a custom string that doesn't need to follow any of the usual path rules. As one example of that, GitHub accepts paths both with and without the leading slash, as you'll see in the URL examples below.






              That being said, Git also supports URL-style addresses. Your example can also be written as:



              ssh://git@github.com/JohnCoates/Aerial.git


              Now the path is /JohnCoates/Aerial.git as you'd expect (in URLs it is always absolute).



              Note that although the path is different, GitHub still accepts it the same way – but a standard Unix server wouldn't. (It would require the full path, with home directory, to be specified.) To continue my earlier example:



              fred@example.com:/home/fred/Projects/App.git

              ssh://fred@example.com/home/fred/Projects/App.git





              share|improve this answer


























                0












                0








                0






                You aren't looking at an URL here – you are looking at a rsh/rcp-style address, similar to what's still being used by scp and rsync these days. So the rsh syntax is different from URLs: everything after the colon is the directory path, and there is no provision for port specification.



                You are still correct that the git in git@... is a Unix username on the server, and github.com is the hostname. I think this is probably something that URLs inherited from rsh-style addresses.



                (The original rsh had an unusual these days security model and did not allow using a different port; ssh uses a separate command-line option -p to change it if needed.)



                So the entire JohnCoates/Aerial.git is a directory path. Why does it not start with a /? First of all, again, because this isn't an URL-format address and uses : as the field separator. Second, because the server does not require the leading slash in paths.





                • On plain Unix SSH servers:



                  The path doesn't need to start with / when it's relative to the current directory. In Git addresses, that means it's relative to the user's home directory.



                  Because RSH/SSH are meant for logging into a system account, they have a concept of "home directory" exactly like local logins do. When you log in to the system, your commands start at /home/UserName (until you cd elsewhere), so running ls Projects is the same as ls /home/UserName/Projects.



                  All software which uses SSH transport – including SFTP, Git, and Rsync – can also use this feature. For example, if you tried to clone from a simple SSH server, using the address fred@example.com:Projects/App.git, that's the same as cloning fred@example.com:/home/fred/Projects/App.git.



                  (As you can see, absolute paths do start with a / – but they are still separated using a : in rcp addresses.)




                • On GitHub, GitLab, and other custom systems:



                  GitHub runs a custom git which does not directly map repository names to filesystem paths. Instead, it manually parses the received path against a regex such as ^/?(.+)/(.+).git$ and looks up the result in a SQL database.



                  So a GitHub "path" is really just a custom string that doesn't need to follow any of the usual path rules. As one example of that, GitHub accepts paths both with and without the leading slash, as you'll see in the URL examples below.






                That being said, Git also supports URL-style addresses. Your example can also be written as:



                ssh://git@github.com/JohnCoates/Aerial.git


                Now the path is /JohnCoates/Aerial.git as you'd expect (in URLs it is always absolute).



                Note that although the path is different, GitHub still accepts it the same way – but a standard Unix server wouldn't. (It would require the full path, with home directory, to be specified.) To continue my earlier example:



                fred@example.com:/home/fred/Projects/App.git

                ssh://fred@example.com/home/fred/Projects/App.git





                share|improve this answer














                You aren't looking at an URL here – you are looking at a rsh/rcp-style address, similar to what's still being used by scp and rsync these days. So the rsh syntax is different from URLs: everything after the colon is the directory path, and there is no provision for port specification.



                You are still correct that the git in git@... is a Unix username on the server, and github.com is the hostname. I think this is probably something that URLs inherited from rsh-style addresses.



                (The original rsh had an unusual these days security model and did not allow using a different port; ssh uses a separate command-line option -p to change it if needed.)



                So the entire JohnCoates/Aerial.git is a directory path. Why does it not start with a /? First of all, again, because this isn't an URL-format address and uses : as the field separator. Second, because the server does not require the leading slash in paths.





                • On plain Unix SSH servers:



                  The path doesn't need to start with / when it's relative to the current directory. In Git addresses, that means it's relative to the user's home directory.



                  Because RSH/SSH are meant for logging into a system account, they have a concept of "home directory" exactly like local logins do. When you log in to the system, your commands start at /home/UserName (until you cd elsewhere), so running ls Projects is the same as ls /home/UserName/Projects.



                  All software which uses SSH transport – including SFTP, Git, and Rsync – can also use this feature. For example, if you tried to clone from a simple SSH server, using the address fred@example.com:Projects/App.git, that's the same as cloning fred@example.com:/home/fred/Projects/App.git.



                  (As you can see, absolute paths do start with a / – but they are still separated using a : in rcp addresses.)




                • On GitHub, GitLab, and other custom systems:



                  GitHub runs a custom git which does not directly map repository names to filesystem paths. Instead, it manually parses the received path against a regex such as ^/?(.+)/(.+).git$ and looks up the result in a SQL database.



                  So a GitHub "path" is really just a custom string that doesn't need to follow any of the usual path rules. As one example of that, GitHub accepts paths both with and without the leading slash, as you'll see in the URL examples below.






                That being said, Git also supports URL-style addresses. Your example can also be written as:



                ssh://git@github.com/JohnCoates/Aerial.git


                Now the path is /JohnCoates/Aerial.git as you'd expect (in URLs it is always absolute).



                Note that although the path is different, GitHub still accepts it the same way – but a standard Unix server wouldn't. (It would require the full path, with home directory, to be specified.) To continue my earlier example:



                fred@example.com:/home/fred/Projects/App.git

                ssh://fred@example.com/home/fred/Projects/App.git






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 23 '18 at 8:24

























                answered Nov 23 '18 at 7:37









                grawity

                232k35491546




                232k35491546






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377716%2fwhat-does-the-name-after-the-colon-in-github-ssh-address-mean%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    QoS: MAC-Priority for clients behind a repeater

                    Ивакино (Тотемский район)

                    Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)