• Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
  • Domains
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • Cloud VPS
  • Dedicated Servers
home/Knowledge Base/Dedicated Servers/Linux Guides/Use Gitolite To Setup Git Repositories on Debian
Popular Search:Dedicated Server, CentOS, Web Hosting

Use Gitolite To Setup Git Repositories on Debian

18 views 0 December 14, 2019 aklwebhost

This tutorial will show you how to easily and conveniently setup git repositories with Gitolite on Debian Wheezy. For the course of this tutorial, we will assume that you are working with administrative privileges. If you want to use sudo instead, append it where necessary.

First, login via SSH and make sure that your packages are up to date and that the dependencies are met:

apt-get update && apt-get upgrade && apt-get install git perl

Gitolite depends on a dedicated user for everything git-related, since it acts as a wrapper around it. You can name it whatever you want. We’ll go with git here:

useradd -m git
passwd git

Make sure that your own SSH public key has been copied on the server by issuing the following command from your client machine:

scp yourkey.pub git@yourserver.tld:˜/yourname.pub

This only works for Linux or BSD workstations. For Windows and OS X, please consult the documentation of your operating system. If you don’t have SSH keys right now, see this AKLWEB HOST doc on how to generate them.

The next step is important. Ensure that your ˜/.ssh/authorized_keys file is empty.

Download and install Gitolite directly from Github since the version in Debian’s repository is outdated:

su git
cd
git clone git://github.com/sitaramc/gitolite
mkdir -p $HOME/bin
gitolite/install -to $HOME/bin

Make yourself an administrative user:

bin/gitolite setup -pk yourname.pub

The installation is complete. Next, you need to add users and repositories. Contrary to “normal” systems management, Gitolite relies on a special repository for user and repository management, it’s called gitolite-admin.

Clone gitolite-admin on your client:

git clone git@yourserver.tld:gitolite-admin

If you cd into gitolite-admin, you should now see two directories:

  • conf
  • keydir

The directory keydir stores the public keys of users, therefore if you wanted to add a user called user1, you would place their public key in the keydir and name it user1.pub.

Adding new repositories is done in the file conf/gitolite.conf. To give user1 read and write access to the repository Testing (which is already there by default) you would have to change it to the following:

repo testing
  5     RW+     =   user1

To make those changes take effect, you have to push the changes to the repository:

git add conf
git add keydir
git commit -m "user1 - testing"
git push

That’s about everything – repeat the process for every new user / repository. Happy coding!

Tags:Use Gitolite To Setup Git Repositories on Debian

Was this helpful?

Yes  No
Related Articles
  • Setup Spigot Server on Arch Linux
  • How To Install OSSEC HIDS on a CentOS 7 Server
  • Initial Setup of a CentOS 7 Server
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Hot Backups with Percona XtraBackup on the One-Click WordPress App
  • Installing Rust on Ubuntu 14.04
Leave A Comment Cancel reply

Linux Guides
  • Use Gitolite To Setup Git Repositories on Debian
  • Setup Spigot Server on Arch Linux
  • How To Install OSSEC HIDS on a CentOS 7 Server
  • Initial Setup of a CentOS 7 Server
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Hot Backups with Percona XtraBackup on the One-Click WordPress App
View All 190  
Popular Articles
  • Using StrongSwan for IPSec VPN on CentOS 7
  • Disabling SSDP (Linux / Windows)
  • Can I pay by Western Union?
  • Can a Coupon Code Discount Be Carried Forward While I Upgrade My VPS Account
  • Can I pay multiple due invoices using a single transaction?
KB Categories
  • Billing
  • Cloud Hosting
  • CMS Hosting
  • cPanel/WHM Control Panel Guide
  • Dedicated Servers
    • AMD Opteron 6272
    • Arch
    • Backup Storage
    • Bandwidth
    • Basic Security
    • BSD
    • CentOS
    • Containers
    • CoreOS
    • DDoS Protection
    • Debian
    • Dedicated Server Control Panel
    • Intel Core i5 3550
    • Intel Core i5 4570
    • Intel Core i7 3770
    • Intel Core i7 4770
    • Intel Xeon E3 1230 V3
    • Intel Xeon E3 1245 V2
    • IP Space
    • Linux Guides
    • Minecraft
    • Networking
    • Server Apps
    • Server Troubleshooting
    • Ubuntu
    • Windows Guides
    • Windows Server 2008
    • Windows Server 2012
  • Domain Names
  • Email Support Documentation
    • Setup IMAP or POP
    • User Features – How To
    • Webmail – How To
  • FTP (File Transfer Protocol
    • CuteFTP Guide
    • FileZilla Guide
  • Game Servers
  • MySQL and MariaDB
  • Node.js
  • Plesk Web Hosting Guide
  • VPS Server
  • Web Servers

  Simple Mailserver With Postfix, Dovecot, And Sieve On Debian 7

Using MySQL Views on Debian 7  

  • Privacy Policy
  • Terms of Use
  • © 2022 AKLWEB HOST LLC, All Rights Reserved.

Popular Search:Dedicated Server, CentOS, Web Hosting