CentOS 7
Ads

Gitolite3 : Install
2015/07/21
 
Install Gitolite which manages Git Repositories.
It's possible to manage users or repositories or access control with it.
[1] Install Gitolite.
# install from EPEL

[root@dlp ~]#
yum --enablerepo=epel -y install gitolite3
[2] Generate SSH key pair and setup Gitolite with Gitolite admin user.
[root@dlp ~]#
su - gitolite3
-sh-4.2$
ssh-keygen -f ~/.ssh/gitadmin

Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
# set passphrase

Enter same passphrase again:
# confirm

Your identification has been saved in /var/lib/gitolite3/.ssh/gitadmin.
Your public key has been saved in /var/lib/gitolite3/.ssh/gitadmin.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx gitolite3@dlp.srv.world
The key's randomart image is:
-sh-4.2$
gitolite setup -pk ~/.ssh/gitadmin.pub

Initialized empty Git repository in /var/lib/gitolite3/repositories/gitolite-admin.git/
Initialized empty Git repository in /var/lib/gitolite3/repositories/testing.git/
-sh-4.2$
vi ~/.ssh/config
# create new

# any name you like

host GitServer
    user gitolite3
   
# Git server's hostname or IP address

    hostname 10.0.0.30
    port 22
   
# secret key

    identityfile ~/.ssh/gitadmin
-sh-4.2$
chmod 600 ~/.ssh/config

-sh-4.2$
git config --global user.name "gitolite3"

-sh-4.2$
git config --global user.email "gitolite3@srv.world"

-sh-4.2$
git config --global push.default simple
# clone admin repository to finish setup

-sh-4.2$
git clone ssh://GitServer/gitolite-admin

Cloning into 'gitolite-admin'...
The authenticity of host '10.0.0.30 (10.0.0.30)' can't be established.
ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)?
yes

Warning: Permanently added '10.0.0.30' (ECDSA) to the list of known hosts.
Enter passphrase for key '/var/lib/gitolite3/.ssh/gitadmin':
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
 
Tweet