Search code examples
gitolite

Setting up Gitolite to have more than 1 admin?


I have a server with gitolite already set up.

I manage the gitolite using a remote machine that has the clone of the gitolite admin.

i.e, In remote machine, I did

git clone git@gitserveraddr:gitolite-admin.git

and manage the users and repos from there.

Now, we would like to have another person in different machine to be able to be the "admin" too. How can I do this?

I tried to add his rsa key into the /home/git/ in the gitserver and run gitolite setup -pk Git-Admin.pub his-key.pub where Git-Admin.pub is the original admin's computer rsa key. and his-key.pub is the new admin

It did not work. The original admin is still fine, but the new admin is not working (cannot do git clone git@gitserveraddr:gitolite-admin.git)

Thanks


Solution

  • You simply need to modify the conf/gitolite.conf file in order to add a new username as having the right (RW+) to read/write to that repo.

    repo gitolite-admin
       RW+ = alice <newAdmin>
    

    You would push as well a new keydir/<newAdmin.pub>, allowing newAdmin to be able to clone/pull/push gitolite-admin.

    No need for any "setup".
    No need to add multiple keys for the same admin account: it is best to clearly identify and separate each admin account, with their own respective set of ssh public/private keys that each account is in charge of managing (and of keeping their private ssh keys... private).