== Create a new SSH key pair for every user or role {{{#!sh ssh-keygen -t ed25519 -f ~/.ssh/KEYNAME }}} Example: {{{#!sh ssh-keygen -t ed25519 -f ~/.ssh/mesechannel }}} This creates: ~/.ssh/mesechannel (private key) ~/.ssh/mesechannel.pub (public key) == Add the new public key to Gitolite === Clone the gitolite-admin repo if you haven't already: {{{#!sh git clone kokyou.dev:gitolite-admin }}} === Copy the user key to the keydir {{{#!sh cd gitolite-admin cp ~/.ssh/mesechannel.pub keydir/mesechannel.pub }}} == Edit conf/gitolite.conf {{{ repo airsituation RW+ = admin mesechannel R = mesepackager repo gitolite-admin RW+ = admin }}} Only admin can write to the gitolite-admin repo Both admin and mesechannel can fully control the airsituation repo. mesepackager can only read the air situation repo == Push changes to effect your setup Once you changed keydir/ and/or conf/, you must commit and push like this: {{{#!sh git add keydir/ git add conf/gitolite.conf git push }}} After push, Gitolite applies changes automatically — no restart needed. == 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. == Push an existing local project to Gitolite From your project directory: {{{#!sh cd ~/projects/myproject git remote add origin gitolite-mesechannel:airsituation git push }}} In case you want to push as admin use {{{#!sh git remote add origin kokyou.dev:airsituation }}} == Clone a repo using different users/keys Example: {{{#!sh git clone gitolite-mesechannel:airsituation }}} or {{{#!sh git clone gitolite-mesepackager:some-other-repo }}} depending on which SSH identity you use. [wiki:Workflows back]