4

I am trying to setup a cgit instance from which you can push or pull over http. However, i am able to browse my repos over http via cgit, but when i try to push to this repo, i get an error:

Fatal, /info/refs not valid, is this a git repository?

This path exists on the server, and this is an empty file. I have created a post-update hook which executes git update-server-info automatically (the post-update.example from the repo). But when i try to view the /info/refs file via http, cgit has an announcement, that this is an empty repository.

What can i do to get access to this file via http, so i can push or pull with the urls that cgit provides to me?

I have my repos on a shared hosting provider, so i have no access to the apache.conf but only to the .htaccess files...

kapa
  • 77,694
  • 21
  • 158
  • 175
simonszu
  • 356
  • 5
  • 14

2 Answers2

1

As far as I can tell, cgit doesn't enable pushing to Git repositories (from looking through their feature list).

You'll likely need to setup something like git-http-backend to be able to push. The git-http-backend manpage has example configurations for Apache 2.x for anonymous read with authenticated write, and for authenticated read and write.

Jacob Helwig
  • 792
  • 4
  • 8
0

If you would like a backend that is more feature rich than git-http-backend, I would recommend gitolite. It has some really nice features:

  • Use a single unix user ("real" user) on the server
  • Provide access to many gitolite users:
    • they are not "real" users
    • they do not get shell access
  • Control access to many git repositories:
    • read access controlled at the repo level
    • write access controlled at the branch/tag/file/directory level, including who can rewind, create, and delete branches/tags
  • Can be installed without root access, assuming git and perl are already installed
  • Authentication is most commonly done using sshd, but you can also use http if you prefer (this may require root access)
  • Store all configuration in an admin git repository

This is just some of the more important features. In addition it is easy to extend its behavior with your own scripts.

stigkj
  • 1,439
  • 14
  • 10
  • I am currently trying gitlab. It seems to be quite big for a small setup with two users and few repos, though. – simonszu Mar 04 '13 at 12:48
  • You could also try something like [Gitblit GO](http://gitblit.com), which is a Java-based git server that is very easy to setup. Or simply use [git over ssh](http://www.mindfuzz.net/?p=250). – stigkj Mar 05 '13 at 13:55
  • Hm. Gitblit is java-based. Since the recent java vulnerabilities outnumber the RoR vulnerabilities, i think i'll stay with gitlab. ;) – simonszu Mar 05 '13 at 15:02
  • He, he...think that would be comparing apples and oranges though. It is not server-side Java that has had so many vulnerabilities lately. It is the applet and webstart part that is the problem. – stigkj Mar 06 '13 at 18:42