0

I try to make a local mirror of a repository

On my Linux apache server I do this:

git clone --mirror --progress -v  git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git

Then I can access it via http://jegkalinux.dk/assets/mmc-utils.git/

Now I try to use it :-(

$ git clone http://jegkalinux.dk/assets/mmc-utils.git
Cloning into 'mmc-utils'...
warning: You appear to have cloned an empty repository.

But

$ git clone /srv/httpd/jegkalinux.dk/public/assets/mmc-utils.git
Cloning into 'mmc-utils'...
done.

The above was done with git version 2.17.1 as my server is a Ubuntu 18.04.6 LTS

I observed the problem on a Ubuntu 20.04.2 LTS with git version 2.25.1 (server not accessible from the internet) Here the repository simply cannot be found, but browsing is ok.

$ git clone http://artifacts.practek.cn/mirror/ingredients_4.0.0/mmc-utils/mmc-utils.git
Cloning into 'mmc-utils'...
fatal: repository 'http://artifacts.practek.cn/mirror/ingredients_4.0.0/mmc-utils/mmc-utils.git/' not found

I suspect that the error comes from the original mirror clone:
When using 2.17.1 to mirror I get "empty repository"
When using 2.25.1 to mirror I get "not found"

Just for the record ex git://github.com/opencontainers/runtime-spec.git works all the way

So why does this error occur on some repositories?

Edit:
Found a similar issue Cloning git repository over HTTP on personal server results in cloning an empty repository However the suggested solution git update-server-info does not help

According to this page https://git-scm.com/book/uz/v2/Git-Internals-Transfer-Protocols The file refs/heads/master is missing on my clone

More worrying I'm missing a lot of subfolders here.

mmc-utils$ ll .git/objects/
total 16
drwxrwxr-x 4 kfc kfc 4096 Mar 29 14:43 ./
drwxrwxr-x 8 kfc kfc 4096 Mar 29 14:43 ../
drwxrwxr-x 2 kfc kfc 4096 Mar 29 14:43 info/
drwxrwxr-x 2 kfc kfc 4096 Mar 29 14:43 pack/

It seems that the files are packed, unpacking these did not help either. (https://stackoverflow.com/a/41810000/1809810)

Kjeld Flarup
  • 1,471
  • 10
  • 15
  • 2
    You're not running a Git server on that web page, it's just the files. The https protocol for Git expects to talk to an actual Git server (e.g., GitLab or some such). – joanis Mar 03 '22 at 15:31
  • This is mainly an Apache server config issue; such questions go on serverfault.com. – torek Mar 05 '22 at 02:17
  • @torek I have an apache server which, has been serving these repositories for almost a decade. And some repositories work, while other don't. I cannot really see why the problem should be with the server. – Kjeld Flarup Mar 07 '22 at 07:13
  • There must be *something* about those particular repositories. Perhaps they're not readable by whichever user the server is running as. – torek Mar 08 '22 at 20:17

0 Answers0