Unable to clone repo with git clone git: // ... - ok with git clone http: //

Git is new here. I am configuring git on a new Ubuntu VM and trying to clone some repositories. The clone works for the following command:

git clone http://github.com/organisation_name/repo_name 

(after prompting for username / password), but failing for

 git clone git://github.com/organisation_name/repo_name 

and

 git clone git://github.com/organisation_name/repo_name.git 

with the same error message:

 Cloning into 'repo_name'... fatal: remote error: Repository not found 

Of course, the obvious answer is β€œuse the http method,” but I'm trying to figure out why one works and the other doesn't. Any suggestions? (is there also a difference when using the .git extension for the btw repo name?)

Thanks!

+7
git git-clone
source share
4 answers

Well, I think you are using the wrong URL in your second case

Try this instead

 git clone git@github.com :organisation_name/repo_name.git 

The difference is : in the URL when using git@ vs the / you are using / and the extra .git at the end.

This should be the same url if you go to github and select the ssh url to clone (and not the default https)

+9
source

If this is a private repository, you need to add your ssh public key ssh to your account at https://github.com/settings/ssh , otherwise you will get the exact error that you list here.

+6
source

I just wanted to throw out there that my problem was online. All my settings were good. I was told that the network does not filter or block ports or anything else, but after trying everything that I could think of and everything that I could find on the Internet; I finally tied my laptop to a mobile phone, and everything began to work fine.

+1
source

Query: Why does the HTTPS URL work and the SSH URL is missing?
The goal of SSH URLs is to provide access to the Git repository through SSH, a secure protocol. To use these URLs, you must create an SSH key pair on your computer and add the public key to your GitHub account.

+1
source

All Articles