Home > Net >  git protocol connection refused
git protocol connection refused

Time:10-28

I created a GIT Remote Repository in localhost.
Then I push my project.
I can clone my project via :

git clone ssh://127.0.0.1/repo-r/haq

But when I want to use git:// or http:// I get the following error:

$ git clone git://127.0.0.1/repo-r/haq/haq.git
Cloning into 'haq'...
fatal: unable to connect to 127.0.0.1:
127.0.0.1[0: 127.0.0.1]: errno=Connection refused

How do I solve it?

CodePudding user response:

You're not running a http server, so you cannot use http to access your repo. It's as simple as that.

Same for the (mostly obsolete) git protocol.

When setting up a http server for git access, you typically have bare repos where you push to from your working non-bare repos. You would not use the same repo.

CodePudding user response:

For local repositories (on localhost), the local protocol remains the most straightforward

The most basic is the Local protocol, in which the remote repository is in another directory on the same host.

This is often used if everyone on your team has access to a shared filesystem such as an NFS mount, or in the less likely case that everyone logs in to the same computer.
The latter wouldn’t be ideal, because all your code repository instances would reside on the same computer, making a catastrophic loss much more likely.

git clone /srv/git/project.git
  • Related