2

The Ubuntu git help provides instructions for configuring gitolite, but Ubuntu 16 LTS delivers gitolite3. The gitolite3 install guide refers the user to their operating system package distribution for installation and initial configuration instructions, but I can't seem to find instructions on the Ubuntu site for gitolite3 configuration.

I installed gitolite3 on Ubuntu 16 with the command:

apt-get install gitolite3

I was prompted for the path to my public key file, and provided it.

I was then able to clone the admin repository with the command:

git clone gitolite3@localhost:gitolite-admin

How do I configure gitolite3 to use the git account instead of the gitolite3 account with Ubuntu 16?

7

Disclaimer: I'm a newbie to both Ubuntu and gitolite.

I think your best option is to go back in time and enter a blank admin key when you first run apt-get install gitolite3. This will skip the configuration. Then you can later configure it by running:

dpkg-reconfigure gitolite3

This asks for three configuration parameters: system username, repository path and admin's SSH key. You can provide git as the user name.

If travelling back in time is not an option, I have found that it's possible to use dpkg-reconfigure gitolite3 on an already installed gitolite system to change the username, but only if you are willing to rm/mv/chmod/chown many directories. This is more than I would feel comfortable doing on a production system and too risky to provide instructions that people might copy & paste without considering how dangerous they are.

Instead, for an already installed gitolite system, you might consider simply renaming the gitolite3 user.

usermod gitolite3 --login git
groupmod gitolite3 -n git

This will enable the conventional usage of git clone git@server:myrepo.

This will also make things a little inconsistent. For example

debconf-show gitolite3

will show that the gitolite3 package still thinks the user is gitolite3, but in my limited testing, gitolite still works.

1
  • Thought I'd share that I was just able to observe my future self enter DEBIAN_PRIORITY=low apt-get install gitolite3 and then enter user name, home directory, and ssh key all at once. Oct 17 '18 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.