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)