Home > Blockchain >  git ls-remote http issue
git ls-remote http issue

Time:08-30

kestrel http server (win7 sp1 x64) running on port 3112 and serve static git repository files

these commands are executed using git bash on win10 and win7 client machines with same results

curl http://server:3112/repository/.git/HEAD
// ok

git ls-remote file://server/shared-folder/repository 
// ok

git ls-remote http://server:3112/repository/.git
// fatal: repository 'http://server:3112/repository/.git/' not found

how to fix this issue?

CodePudding user response:

When you're exposing a repository over HTTP or HTTPS, there are two ways you can do so: the legacy protocol, which uses WebDAV, and the smart protocol. In both situations, Git needs more than just the HEAD reference: it also needs some data under the path info/refs which tells it (a) which protocol it's using and (b) information about what references are available. It also needs a way with the legacy protocol to determine what objects and packs exist. This is because HTTP doesn't provide standardized directory and file listings, and as a consequence Git has to have this information generated.

Git by default ships with a post-update hook which calls the git-update-server-info program, which generates the necessary files by default. You'll need to run this before it can be accessed over HTTP and also any time the repository changes.

Note that even if you do this, without further configuration this repository will be read only. You can read more about how to configure a read-write server with the smart protocol and CGI using git http-backend --help.

  • Related