| 3 | ssh-keygen -t ed25519 -f ~/.ssh/KEYNAME |
| 4 | Example: |
| 5 | |
| 6 | ssh-keygen -t ed25519 -f ~/.ssh/mesechannel |
| 7 | ✅ Creates: |
| 8 | |
| 9 | ~/.ssh/mesechannel (private key) |
| 10 | ~/.ssh/mesechannel.pub (public key) |
| 11 | 2. 🗝️ Add the new public key to Gitolite |
| 12 | |
| 13 | Clone the gitolite-admin repo if you haven't already: |
| 14 | |
| 15 | git clone kokyou.dev:gitolite-admin |
| 16 | (use your admin key). |
| 17 | |
| 18 | Then: |
| 19 | |
| 20 | cd gitolite-admin |
| 21 | cp ~/.ssh/mesechannel.pub keydir/mesechannel.pub |
| 22 | ✅ You added the user key. |
| 23 | |
| 24 | 3. 🛠️ Edit conf/gitolite.conf |
| 25 | |
| 26 | Edit conf/gitolite.conf: |
| 27 | |
| 28 | @devs = mesechannel mesepackager |
| 29 | |
| 30 | repo airsituation |
| 31 | RW+ = @devs |
| 32 | |
| 33 | repo gitolite-admin |
| 34 | RW+ = admin mesechannel |
| 35 | ✅ Both admin and mesechannel can now fully control Gitolite. |
| 36 | |
| 37 | 4. 📤 Admin Push Syntax (VERY IMPORTANT) |
| 38 | |
| 39 | Once you changed keydir/ and/or conf/, you must commit and push like this: |
| 40 | |
| 41 | git add keydir/ |
| 42 | git add conf/gitolite.conf |
| 43 | git commit -m "Add mesechannel as dev and admin" |
| 44 | git push |
| 45 | In short: |
| 46 | |
| 47 | Always git add the modified files. |
| 48 | Always git commit. |
| 49 | Always git push to update Gitolite immediately. |
| 50 | ✅ After push, Gitolite applies changes automatically — no restart needed. |
| 51 | |
| 52 | 5. 🔐 Edit local ~/.ssh/config |
| 53 | |
| 54 | Host kokyou.dev |
| 55 | User git |
| 56 | IdentityFile ~/.ssh/admin |
| 57 | IdentitiesOnly yes |
| 58 | |
| 59 | Host gitolite-mesechannel |
| 60 | HostName kokyou.dev |
| 61 | User git |
| 62 | IdentityFile ~/.ssh/mesechannel |
| 63 | IdentitiesOnly yes |
| 64 | |
| 65 | Host gitolite-mesepackager |
| 66 | HostName kokyou.dev |
| 67 | User git |
| 68 | IdentityFile ~/.ssh/mesepackager |
| 69 | IdentitiesOnly yes |
| 70 | ✅ SSH knows which key to use depending on which Host alias you reference. |
| 71 | |
| 72 | 6. 🚀 Push an existing local project to Gitolite |
| 73 | |
| 74 | From your project directory: |
| 75 | |
| 76 | cd ~/projects/myproject |
| 77 | git remote add origin gitolite-mesechannel:airsituation |
| 78 | git push -u origin main |
| 79 | ✅ Your full project history is uploaded. |
| 80 | |
| 81 | 7. 📥 Clone a repo using different users/keys |
| 82 | |
| 83 | Example: |
| 84 | |
| 85 | git clone gitolite-mesechannel:airsituation |
| 86 | or |
| 87 | |
| 88 | git clone gitolite-mesepackager:some-other-repo |
| 89 | depending on which SSH identity you use. |