from Hacker News

Hosting git repositories on your VPS

by robermiranda on 7/1/13, 1:26 PM with 22 comments

Today I’ll show you how to setup a gitolite installation on a VPS with Ubuntu 12.04 LTS. To save myself some typing I’ll be using the following conventions:

A command prefixed by sysadmin$ is meant to be run in your local workstation.

A command prefixed by user@vpshost:path# is meant to be run in the vps under the specified user on the specified path.

  • by zrail on 7/1/13, 2:28 PM

    This is pretty good. I wrote a similar article last year[1] that goes more in depth on things like automatic mirrors and various types of hooks. It was fairly well received on HN[2].

    [1]: http://www.petekeen.com/hosting-private-git-repositories-wit...

    [2]: https://news.ycombinator.com/item?id=4707747

  • by masnick on 7/1/13, 1:51 PM

    I used gitolite on a VPS previously and it worked well, but when Bitbucket introduced free unlimited private repositories I switched.

    IMO there is no reason to use gitolite now for unless you have (a) sensitive repos (with your own server, not a VPS of course), or (b) lots of private repos with lots of collaborators and you have no money for a Github or Bitbucket monthly fee and you aren't a non-profit (I think non-profits can get a free Bitbucket account).

    That said, I'm interested to hear about other gitolite use cases I haven't thought of.

  • by dotmanish on 7/1/13, 2:58 PM

    We recently were at the same crossroads (choosing between "github" v/s "bitbucket" v/s own-hosted git repositories). I ran through the various options for own-hosted git repositories: (1) Gitlab, (2) Gitolite, and (3) Stash (10-user license for $10)

    We ended up installing Stash as it seemed that it would reduce administration+maintenance by a tad bit (GUI + knowledgebase) and would be supported by a company responsible for bitbucket. Stash has been a pleasant experience so far.

  • by gbrindisi on 7/1/13, 4:22 PM

    Does anybody know if there is something to seamlessly encrypt a git repository in case I don't trust the git server provider (say a VPS)?
  • by e12e on 7/1/13, 5:23 PM

    Any particular reason why most of the examples uses "sudo" while already logged in as root?

    Additionally, either you have some strange prompts set up somewhere, or made a few typos when copying and pasting; a couple of places you appear to be logged in as a someuser@<...>, but with a hash-prompt(#) -- usually reserved for indicating root/super user access.

    edit: Personally, I actually found the official documentation more helpful, even if it is very brief:

    http://gitolite.com/gitolite/qi.html

    In particular, it highlights that gitolite needs to run under a user, and needs a (your, the admin's) pubkey for setup -- but there's no need to generate a new one.

    Behind the scenes, the pubkey used is added to the gitolite user's authorized_keys-file (and so is any other keys added, when users are added).

  • by tkorri on 7/1/13, 7:16 PM

    One other option to gitolite is SCM-Manager[1]. It's written in Java and can be deployed to an application server or installed as a standalone version.

    I've used it for a year and I've been quite happy with it.

    [1]: http://www.scm-manager.org/

  • by gee_totes on 7/1/13, 7:45 PM

    A nice alternative to gitolite is gitosis[0]. I've found it much easier to use (in terms of adding users to repos) and faster to spin up new repos.

    https://wiki.archlinux.org/index.php/Gitosis

  • by emanuelez on 7/1/13, 1:47 PM

    Or, if you are a company and need some structure and ease of use, you can try contacting the guys at gitgear.com