Nov 30, 2012

Installing gitolite in CentOS 6

Gitolite is an management service that sits on top of git. It helps restrict users to certain projects (and what they can do on those projects). In this post we will install gitolite in a CentOS 6 environment.

  1. First we need to enable the EPEL repository. You could download and install gitolite directly, but I prefer to manage everything through the package manager for auditing purposes.
    wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
    rpm -ivh ./epel-release-6-7.noarch.rpm
  2. Install gitolite (it will most likely install a variety of dependencies):
    yum install gitlolite
  3. If this is a brand new gitolite installation you will need to create a public SSH key on the account you will be using to administer your gitolite installation. The creation of these keys are outside the scope of this documentation. Once the key pair has been created, copy the public version to a common place where gitolite can access it (like temp). Use the command cp or scp to acheive this.
  4. Rename your copied public key with some sort of identifier. Gitolite uses the name of your keys to determine access.
  5. Log in as the gitolite user:
    su - gitolite
  6. Initialize your gitolite service with the key:
    gl-setup -q /tmp/user.pub
  7. Now you can use gitolite!
    ssh gitolite@192.168.0.1 info
    git clone gitolite@192.168.0.1:gitolite-admin.git

Further Reading:

No comments:

Post a Comment

Thanks for contributing!! Try to keep on topic and please avoid flame wars!!