I wanted to mirror my git repository, so I did the following over SSH:
$ mkdir tvshowtracker.git
$ cd tvshowtracker.git
$ git init --bare
then, locally:
$ git remote add rolisoftdotnet ssh://rolisoft@rolisoft.net/repos/tvshowtracker.git
$ git push rolisoftdotnet master
Now, if I want to clone my repository elsewhere, it works if I do it over SSH:
$ git clone ssh://rolisoft@rolisoft.net/repos/tvshowtracker.git
Cloning into tvshowtracker...
rolisoft@rolisoft.net's password:
remote: Counting objects: 1423, done.
remote: Compressing objects: 100% (460/460), done.
remote: Total 1423 (delta 953), reused 1423 (delta 953)
Receiving objects: 100% (1423/1423), 2.08 MiB | 355 KiB/s, done.
Resolving deltas: 100% (953/953), done.
However, if I want to do it over HTTP, it fails with this error:
$ git clone http://lab.rolisoft.net/repos/tvshowtracker.git
Cloning into tvshowtracker...
warning: remote HEAD refers to nonexistent ref, unable to checkout.
I tried issuing every command I’ve seen in related posts, but nothing helped.
I just started playing with git, so I don’t know what 90% of the commands do, but I tried them anyways.
$ git push --all rolisoftdotnet
$ git branch -r
$ git branch master rolisoftdotnet/master
$ git checkout master
The reason I’d like HTTP access is to provide a public read-only access to my project.
Try running
git update-server-infoon the server repository. You need to do that after any push to the repository if you want it to be fetchable over the dumb HTTP transport.