15

I recently tried to setup git repo on a linux box and wasted about 10 hours with absolutely no results. There aren't any problems with compilation or anything like that, it's just configuration issue. 2 hours later I got mercurial to do everything i need:

  1. public repos
  2. web ui
  3. push/pull with per-user permissions (not tied to linux accounts)

Everything that I can see about git assumes that you are either just running it locally, using github or already have everything setup. I'm either not looking for the right keywords or there just no or very little info on the subject.

I do want to try git, but setting it up is a very discouraging experience. Can anyone point to something useful in these terms?

thank you!

CharlesB
  • 86,532
  • 28
  • 194
  • 218
alex
  • 2,036
  • 2
  • 16
  • 19

2 Answers2

13

I believe (but I have not tried it yet) that gitosis is the way to go in order to:
Update: 2011, I have actually deployed gitolite

  • make hosting git repos easier and safer. It
  • manages multiple repositories under one user account, using SSH keys to identify users.
    End users do not need shell accounts on the server, they will talk to one shared account that will not let them run arbitrary commands.

The installation process I recommand is one done from a client post in order to copy the full installation of gitolite on the server:

(from-client method) install from the client to the server

Remember: gitolite manages authorization, not authentication (SSH): it can be used without SSH, but its natural deployment is through SSH and the forced command mechanism. (like gitosis was, but with many more features)


Old references for gitosis:

Here is a step-by-step tutorial.

And then an application of the tutorial: Gitosis — making hosting multiple Git repositories manageable (for Mac) or installing gitosis on Ubuntu

Followed by: Adding users to our secure Git setup

Finished with: Git subprojects (since your gitosis server manages all those different git repositories)


For truly light (cgi server) public Git repositories, you can:

  • set up a git server: git-daemon; it will listen on port 9418. By default, it will allow access to any directory that looks like a git directory and contains the magic file git-daemon-export-ok. Passing some directory paths as git-daemon arguments will further restrict the exports to those paths.
    You can also run git-daemon as an inetd service;
  • export with http place the newly created bare git repository in a directory that is exported by the web server, and make some adjustments to give web clients some extra information they need

Here is how to do it on an Apache server.


The 2010 article "8 ways to share your git repository" mentions all the possibilities to give access to a Git repository.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Tutorial erroneously assumes that I want to use SSH and that my client is Linux based. Unfortunately gitosis and that tutorial have contributed significantly to the time I've wasted trying to get git to work :( – alex Mar 06 '09 at 21:41
  • Sorry to hear that. "Linux box": what distro are you using ? And what specific difficulties were you facing by using gitosis (you may add all those data to your question, for hopefully getting better answer). In the meantime, I will try gitosis on my Ubuntu setup tomorrow ;) – VonC Mar 06 '09 at 21:45
  • The problem is that all of this is SSH based. Is it possible at all to install git on a cgi server, say lighttpd? – alex Mar 06 '09 at 22:00
  • It should be mentioned that gitosis is no longer being maintained. Gitolite is now what people are using, instead. https://github.com/sitaramc/gitolite – Sebastian Celis Apr 06 '11 at 13:48
  • @Sebastian: 100% agreed. I have actually deployed (since that old answer) gitolite ;) – VonC Apr 06 '11 at 14:11
  • @Sebastian: I have update my answer with references to gitolite, plus the article "8 ways to share your git repository" (http://www.jedi.be/blog/2009/05/06/8-ways-to-share-your-git-repository/#) – VonC Apr 06 '11 at 14:21
1

You could just do

git instaweb

if you have lighttpd installed. That is only the web GUI, though.

Derek Mahar
  • 27,608
  • 43
  • 124
  • 174
stigkj
  • 1,439
  • 14
  • 10