3

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 [email protected]:project.git
git remote add origin [email protected]:project.git

So far, so good. But:

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

git clone [email protected]:project.git
git remote add origin [email protected]: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

3 Answers 3

6

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.

2
  • Wow, very complete and well written answer! Didn't knew about gitolite, will install it right now. Thank you. :-)
    – Arko
    Jan 23, 2011 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 "[email protected]", had to rename it "user.pub" to make it work with gl-setup.
    – Arko
    Jan 23, 2011 at 21:10
2

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]

0

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…

1
  • 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, 2011 at 21:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .