Installing Gitolite on CentOS 7

You’ll use your public key to administer the gitolite server[^1]. I
saved mine in /tmp/


# Create a gitolite service account and switch to it
useradd git
su - git

# Create a folder from where gitolite will run ($HOME/bin should be in $PATH)
mkdir -p $HOME/bin
git clone /tmp/gitolite

# Install the gitolite scripts
/tmp/gitolite/install -to $HOME/bin

# Set up gitolite with your key
gitolite setup -pk /tmp/

# That's it! :)


# Clone the admin repository
git clone

# Edit the config file to add/edit repositories and permissions
vim gitolite-admin/conf/gitolite.conf

# Add/remove any keys in the key directory
cp gitolite-admin/keydir/

# Commit and push. Gitolite will set up remote.
git add .
git commit -m "Added blah repo"
git push

If you see anything weird when cloning the Gitolite admin repository,
hose everything and start over:

rm -rf ~/.gitolite* ~/bin/* ~/projects.list ~/repositories


If running SSH on a different port, an SSH config file is your friend.
Here’s a sample ~/.ssh/config

Host gitserver
    Port 3574
    User git
    # Don't need if using default
    # IdentityFile ~/.ssh/

Then clone with

git clone gitserver:gitolite-admin
git clone gitserver:my-repository


[^1]: You can simply use ~/.ssh/ in your home folder.
Generate with ssh-keygen -t rsa.