Home > database >  What are the differences between 'git clone git://' and 'git clone https://'? [d
What are the differences between 'git clone git://' and 'git clone https://'? [d

Time:09-27

I just noticed that when people clone a remote repository from Github, they sometimes use a URL starting with 'git://' instead of 'https://'.

I have never heard about the former before.

Is there any noteworthy difference by any mean between those two url conventions?

Is there any other form that is like 'git://'?

CodePudding user response:

These are two different protocols that can be used to communicate with the remote git providers. The major differences being that the git protocol (git://) is much faster than Http Protocol (https:// or http://) as it uses the same data-transfer mechanism as the SSH protocol but without the encryption and authentication overhead.

So generally, you can use SSH or HTTPS access for developers who have push (write) access and have everyone else can use git:// for read-only access.

There are other protocols as well like ssh (kinda fast but with authentication) and local protocol. The detailed pros and cons and be found in the official wiki - https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols

CodePudding user response:

git supports 4 different protocols to connect with; ssh, http, https and lastly git. Each have their pros and cons. For example git protocol have a dedicated port number (9418) and it is often the fastest protocol available, but comes with no authentication. In contrast, https has authentication but it is tricky to set on up on a server.

Perhaps take a look at this link for more info.

  • Related