1. Create a user
#创建gitadmin用户useradd gitadmin# set gitadmin password passwd gitadmin# create git user useradd git# set git password passwd git
2. Create an SSH key
#切换到gitadmin > Su gitadmin# create an ssh key > ssh-keygengenerating public/private RSA key pair. #注意, The following gitadmin is the input entered into the which to save the key (/HOME/GITADMIN/.SSH/ID_RSA): gitadmin# below the direct carriage can enter passphrase ( Empty for no passphrase): #下面直接回车就可以Enter same passphrase again:
This time, you can see these two files under the/home/gitadmin/.ssh
Gitadmingitadmin.pub
Copy gitadmin.pub to temp directory
Cp/home/gitadmin/.ssh/gitadmin.pub/tmp
3. Set up a git user
#登录git用户su git
Set up a Gitolite project
git clone git://github.com/sitaramc/gitolitemkdir-p $HOME/bingitolite/install-to $HOME/bin
Set Gitadmin user as Super admin
#复制上面的ssh密钥cp/tmp/gitadmin.pub ~/#设置成为超级管理员gitolite setup-pk gitadmin.pub
4. Manage the project through Gitolite
#切换到gitadmin用户su gitadmin# build gitolite project management repository git clone [email protected]:gitolite-admin# then enter gitadmin password!
At this point, the general completion of the construction of the environment. Detailed user and warehouse settings can be found here: https://github.com/sitaramc/gitolite
Has fun with git!
[CentOS] Use Gitolite to build git server