How do you change the username or home directory path in Gitolite3?

When moving data to another server, you sometimes need to specify a non-default directory for Gitolite’s working files and repository directories. I decided to write down how to do this, since I keep forgetting.
Let’s install gitolite3:
sudo apt install gitolite3
When it asks for a key, interrupt the installation, then run “dpkg-reconfigure” to configure the package:
sudo dpkg-reconfigure gitolite3
There you can change the username and home directory path, and specify the administrator’s public key.
If you already have the package installed and configured and only want to rename the user and their group, as was the case for me, just run these commands:
sudo usermod gitolite3 --login git
sudo groupmod gitolite3 -n git
All the information was taken from here.
Comments are closed. Read the original discussion in Russian →