I am looking for a way to host private git repos on my own server.
I am using Github for Open source projects of mine, but I would prefer to use my own server for storing private git repos.
Can someone suggest me on which script should I be using for this purpose.
Trac is not what I am looking for, though. I want something that is, preferably PHP based solution (just optional) and esp. something that has an easier UI.
Any help is appreciated here.
Well, for non-gitosis/gitorious setup you have two options really:
/home/ac/.ssh/authorized_keys2whose shell is set to/usr/bin/git-shell. This means they won’t be able to log in as a linux user with a shell and so do anything except use git on your machine.In both cases, the user in question needs (read|write|both) access to the git repository, according to your needs, either as a user or as part of a group.
It might make sense for you to have a directory /git/project and then have user repositories in there, as having multiple people pushing to the same repository is generally a bad idea (people break things too easily in my experience). For example, you might have
/srv/git/proj/proj-ninefingers.gitand have a “release” repo of ‘/srv/git/proj/project.git` That’s probably what I’d do if running a team effort. Permissions, shells etc to be set as appropriate.Note that if you want to allow exports via the read-only git protocol you need to ensure the configured git user has read access and that
git-daemon-export-okexists in your bare repository.git update-server-infomust also be run beforegitwebwill pick up the repository, should you wish to use that.As others have said,
git gcoptimises the repository and it is a good idea to do this regularly. Cron job?Finally, a plethora of frameworks exist to simplify this (gitosis, gitorious, …). I don’t think it gets any simpler than providing access to a folder via various mechanisms but then that’s me.
As an example of my setup, it being only me, I have:
This means anyone with the private key user1 can log in and commit to either of those repositories.