git protocol connection refused

Issue

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?

Solution

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.

Answered By – Marcus Müller

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published