How to configure centos git server and GITOLITE

Source: Internet
Author: User

Recently, I set up a Git server for my team. The path is tortuous and I wrote it down for query. The Centos6.4 64-bit version is used for internal servers.

Install Git

Install git

First install the required git Library:

Yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
Download the Git installation file

Wget http://git-core.googlecode.com/files/git-1.9.0.tar.gz
Install

Tar zxvf git-1.9.0.tar.gz
Cd git-1.9.0
Make prefix =/usr/local all
Make prefix =/usr/local install # run as the root user
Install gitolite
First create a user git and generate an ssh-key

// Create a git User and user group and create a user folder
Sudo useradd-c 'Git version manage'-m-d/home/git-s/bin/bash -- users-group git
// Change the password
Passwd git
// Generate the ssh-key of git
Su git
Ssh-keygen-t rsa-C "your name"
Ssh-copy-id git@127.0.0.1
Enter ssh git@127.0.0.1 to see if password-free login is possible. Download gitolite

Git clone git: // github.com/sitaramc/gitolite
Start Installation

Mkdir bin
~ /Gitolite/install-~ /Bin
Mv ~ /. Ssh/authorized_keys ~ /Git. pub
~ /Bin/gitolite setup-pk ~ /Git. pub
Two versions of libraries/home/git/repositories/gitolite-admin.git/home/git/repositories/testing. git are initialized to test whether the installation is successful.

Ssh git@127.0.0.1
If the output is as follows, the operation is successful:

Hello git, this is git @ linux-dev running gitolite3 v3.5.2-4-g62fb317 on git1.8.1.2

R w gitolite-admin
R w testing
Add administrator key

Git clone git@127.0.0.1: gitolite-admin.git
Generate an ssh public key on the development machine, upload it to the gitolite-admin/keydir directory, and name it with the user name.

Scp ~ /. Ssh/id_rsa.pub git @ server:/tmp/id_rsa.pub
Edit the configuration file:

@ Admin = admin git
@ All = admin dev1 dev3 dev2
Repo pub/CREATOR/. + $
C = @ all
RW + = CREATOR
RW = WRITERS
R = READERS @ admin
Repo gitolite-admin
RW + = @ admin

Repo testing
RW + = @ all
After the configuration is complete and submitted, each user can create a repository and assign permissions under the corresponding user name Directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.