wiki:Give users access to gitolite repos

Version 3 (modified by enno, 4 weeks ago) ( diff )

--

  1. 🗝️ Create a new SSH key pair

ssh-keygen -t ed25519 -f ~/.ssh/KEYNAME Example:

ssh-keygen -t ed25519 -f ~/.ssh/mesechannel ✅ Creates:

~/.ssh/mesechannel (private key) ~/.ssh/mesechannel.pub (public key)

  1. 🗝️ Add the new public key to Gitolite

Clone the gitolite-admin repo if you haven't already:

git clone kokyou.dev:gitolite-admin (use your admin key).

Then:

cd gitolite-admin cp ~/.ssh/mesechannel.pub keydir/mesechannel.pub ✅ You added the user key.

  1. 🛠️ Edit conf/gitolite.conf

Edit conf/gitolite.conf:

@devs = mesechannel mesepackager

repo airsituation

RW+ = @devs

repo gitolite-admin

RW+ = admin mesechannel

✅ Both admin and mesechannel can now fully control Gitolite.

  1. 📤 Admin Push Syntax (VERY IMPORTANT)

Once you changed keydir/ and/or conf/, you must commit and push like this:

git add keydir/ git add conf/gitolite.conf git commit -m "Add mesechannel as dev and admin" git push In short:

Always git add the modified files. Always git commit. Always git push to update Gitolite immediately. ✅ After push, Gitolite applies changes automatically — no restart needed.

  1. 🔐 Edit local ~/.ssh/config

Host kokyou.dev

User git IdentityFile ~/.ssh/admin IdentitiesOnly yes

Host gitolite-mesechannel

HostName kokyou.dev User git IdentityFile ~/.ssh/mesechannel IdentitiesOnly yes

Host gitolite-mesepackager

HostName kokyou.dev User git IdentityFile ~/.ssh/mesepackager IdentitiesOnly yes

✅ SSH knows which key to use depending on which Host alias you reference.

  1. 🚀 Push an existing local project to Gitolite

From your project directory:

cd ~/projects/myproject git remote add origin gitolite-mesechannel:airsituation git push -u origin main ✅ Your full project history is uploaded.

  1. 📥 Clone a repo using different users/keys

Example:

git clone gitolite-mesechannel:airsituation or

git clone gitolite-mesepackager:some-other-repo depending on which SSH identity you use. back

Note: See TracWiki for help on using the wiki.