Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why git clone git:// is not working

Tags:

git

github

ssh

// This works
git clone https://github.com/foreverjs/forever.git

// This one also works
git clone [email protected]:foreverjs/forever.git

// This one didn't work
git clone git://github.com/foreverjs/forever.git

The error message for the third one is:

Cloning into 'forever'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

As far as I know, git clone over SSH or HTTPS is more restricted than git:// protocol. I'm really confused why I got the this error message since git:// protocol doesn't even require for authentication.

Is github only allowed git clone over SSH or HTTPS now or I missed something here?

like image 624
Chuang Fu Avatar asked Sep 10 '25 23:09

Chuang Fu


1 Answers

The gitconfig file in my local computer caused this problem, I found the following two lines in ~/.gitconfig file:

[url "ssh://"]
    insteadOf = git://

If I removed these two lines, the git:// protocol will not run over SSH so there will be no more permission issues

like image 118
Chuang Fu Avatar answered Sep 12 '25 12:09

Chuang Fu