Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't clone repo using git clone git://... - ok with git clone http://

Git newbie here. I'm setting up git on a new Ubuntu VM and trying to clone some repos. The clone works for the following command:

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

(after prompt for username/password), but fails for

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

and also

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 understand why one works and the other doesn't. Any suggestions? (also is there any difference when using the .git extension on the repo name btw?)

Thanks!

like image 908
Tony B Avatar asked Oct 30 '13 13:10

Tony B


People also ask

Why my git clone is not working?

If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.

How do I resolve authentication failed in git clone?

The “fatal: Authentication failed” error message Instead you need to generate a personal access token. This can be done in the application settings of your Github account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual.

How to clone a git repository?

To clone a git repository, use the “git clone” command with the URL of your Git repository. For example, let’s say that you want to clone a public repository from Github, you are going to execute the following command

Why is my Git clone not working?

In some cases, you may be facing authentication failures when performing git clone. Make sure that you are writing the correct password when cloning a repository. In the section dedicated to git clone with password, you may need to inspect the git-credentials file.

What happens when you clone a repository?

By default, clone will create a reference to the remote repository called origin. This opens in a new window. Cloning a repo allows you to make local changes to the repository before committing and pushing them to the remote.

What is the--bare argument in Git clone?

With the --bare argument passed to git clone, you will have a copy of the remote repo created with an excluded working directory. So, the repository will be created with the project history which can be pushed or pulled from but cannot be edited.


1 Answers

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

Try this instead

git clone [email protected]:organisation_name/repo_name.git

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

This should be the same url if you go to github and select the ssh url for cloning (and not the https one selected by default)

like image 93
Anshul Goyal Avatar answered Sep 30 '22 19:09

Anshul Goyal