Centos6.3/debian6, 7 build a git Server 1. centos OS: centos63 (Final) git: 1.7.1 gitolite steps are simple. You need to install git, ssh support, gitolite, and then public key. 1. log on to the server and install it. (# It is after root logon .) # yum install perl openssh git cannot be installed, then install the following dependencies # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel2. create a user # adduser -- system -- shell/bin/sh -- create-home -- home-dir/home/git # cd/home/git # mkdir repositori Es # chown git: git-R. /repositories # chmod 700. /repositories 3. switch to the just-built git user ($ indicates the user) # su git $ git clone git: // github.com/sitaramc/gitolite $ mkdir-p $ HOME/bin $ gitolite/install-to $ HOME/bin. If the missing module is reported, you need to switch to the root to install the missing module. for example, perl-Time-HiRes: $ su-enter the root password of the server # yum install perl-Time-HiRes # su git $ gitolite/install-to $ HOME/bin. finished. local Machine. Here I am debian, # ssh-keygen # cd/root /. there is id_ras.pub in ssh. And id_rsa. One is the public key and the other is the private key. If you have installed openssl to generate a key, do not overwrite the/tmp # scp ~ copied to the server ~ /. Ssh/id_rsa.pub server_username @ server_host:/tmp enter the password to return to the server, # cd/tmp # mv id_rsa.pub admin. why should I change pub to admin. pub uses gitolite to set up an account based on the file name. here I use admin # su git to switch to git user $ HOME/bin/gitolite setup-pk admin. pub and go to/home/git/repositories to see the repository file. gitolite-admin.git and test. git: manages the repository, and tests the code of pulling servers from the local machine # git clone git @ server_host: After gitolite-admin enters the repository, You can see conf, keydir, conf/gitolite. conf is the configuration for adding a user/Repository, and keydir is the public key of the corresponding user. after modification, you can push it directly.