If you install gitosis on ubuntu-server 10.10 via apt-get:

sudo apt-get install gitosis

The post-install script will create a new gitosisuser.

This user will be used to allow people to connect with SSH using public keys. That is, without requiring each user to have their own account on your server:

git clone gitosis@server.com:project.git
git remote add origin gitosis@server.com:project.git

So far, so good. But:

I have seen many times and I personally prefer to use the gitusername for that:

git clone git@server.com:project.git
git remote add origin git@server.com:project.git

  1. Is there any reason we use gitosis instead of simply git on ubuntu-server?
  2. Should I avoid renaming the gitosis user to git with: sudo usermod -l git gitosis

Any idea welcome

up vote 6 down vote accepted

The gitosis username is just a default, likely selected to not conflict if you already had a git user.

The gitosis package in Debian asks what username and directory you want to use, although they might be low priority questions and not asked by default, it should be the same way in Ubuntu. You can run the command sudo dpkg-reconfigure gitosis to reconfigure the package and prompt you for the username and directory to use. The package most likely will not rename the existing user though. If you do that yourself then reconfigure it, any potential issues should be avoided if the package is upgraded, otherwise it will just create a new gitosis user. If you don't rename the user but reconfigure the package and select a new username but keep the same directory without removing its contents first, it will likely cause issues.

As an aside though I want to point out that gitosis has been deprecated in the git community and replaced by gitolite which does basically the same thing but is better in every way. I just checked the Debian package for gitolite, which is also available in Ubuntu 10.10, and it uses gitolite as the default username and /var/lib/gitolite as the default directory. It does however ask for the username and directory to use but they are low priority questions and not asked by default. To install gitolite and be asked all the questions you can use sudo DEBIAN_PRIORITY=low aptitude install gitolite.

  • Wow, very complete and well written answer! Didn't knew about gitolite, will install it right now. Thank you. :-) – Arko Jan 23 '11 at 15:28
  • Well, removed gitosis and installed gitolite with your command. Was asked for user name and path. Had an issue with my keyfile named "user@host.pub", had to rename it "user.pub" to make it work with gl-setup. – Arko Jan 23 '11 at 21:10

I would recommend using Gitolite instead of Gitosis since it isn't supported anymore. Here is a guide on how to setup Gitolite: How to install and setup a Git Repository Server using Gitolite on Linux Ubuntu 10.04 & 11.04 [Development Environment]

We have gitosis running one of our servers on Ubuntu 10.04. I created a user git specifically for the purpose you describe and it runs without any problems.

I'm not sure what the implications would be of renaming the gitosis user though…

  • Done it earlier, no issues server side. All went fine. But you will have to update all your remote urls client side, or reclone all your repos with the new git username. – Arko Jan 23 '11 at 21:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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