Changes between Version 3 and Version 4 of Give users access to gitolite repos


Ignore:
Timestamp:
04/29/25 21:17:12 (4 weeks ago)
Author:
enno
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Give users access to gitolite repos

    v3 v4  
    1 1. 🗝️ Create a new SSH key pair
     1== Create a new SSH key pair for every user or role
    22
     3{{{#!sh
    34ssh-keygen -t ed25519 -f ~/.ssh/KEYNAME
     5}}}
     6
    47Example:
    58
     9{{{#!sh
    610ssh-keygen -t ed25519 -f ~/.ssh/mesechannel
    7 ✅ Creates:
     11}}}
     12
     13This creates:
    814
    915~/.ssh/mesechannel (private key)
    1016~/.ssh/mesechannel.pub (public key)
    11 2. 🗝️ Add the new public key to Gitolite
    1217
    13 Clone the gitolite-admin repo if you haven't already:
    1418
     19== Add the new public key to Gitolite
     20
     21=== Clone the gitolite-admin repo if you haven't already:
     22
     23{{{#!sh
    1524git clone kokyou.dev:gitolite-admin
    16 (use your admin key).
     25}}}
    1726
    18 Then:
     27=== Copy the user key to the keydir
    1928
     29{{{#!sh
    2030cd gitolite-admin
    2131cp ~/.ssh/mesechannel.pub keydir/mesechannel.pub
    22 ✅ You added the user key.
     32}}}
    2333
    24 3. 🛠️ Edit conf/gitolite.conf
    25 
    26 Edit conf/gitolite.conf:
    27 
    28 @devs = mesechannel mesepackager
    29 
     34== Edit conf/gitolite.conf
     35{{{
    3036repo airsituation
    31     RW+ = @devs
     37    RW+ = admin mesechannel
     38    R   = mesepackager
    3239
    3340repo gitolite-admin
    34     RW+ = admin mesechannel
    35 ✅ Both admin and mesechannel can now fully control Gitolite.
     41    RW+ = admin
     42}}}
    3643
    37 4. 📤 Admin Push Syntax (VERY IMPORTANT)
     44Only admin can write to the gitolite-admin repo
     45Both admin and mesechannel can fully control the airsituation repo.
     46mesepackager can only read the air situation repo
     47
     48== Push changes to effect your setup
    3849
    3950Once you changed keydir/ and/or conf/, you must commit and push like this:
    4051
     52{{{#!sh
    4153git add keydir/
    4254git add conf/gitolite.conf
    43 git commit -m "Add mesechannel as dev and admin"
    4455git push
    45 In short:
     56}}}
    4657
    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.
     58After push, Gitolite applies changes automatically — no restart needed.
    5159
    52 5. 🔐 Edit local ~/.ssh/config
     60== Edit local ~/.ssh/config
    5361
    5462Host kokyou.dev
     
    6876    IdentityFile ~/.ssh/mesepackager
    6977    IdentitiesOnly yes
    70 ✅ SSH knows which key to use depending on which Host alias you reference.
    7178
    72 6. 🚀 Push an existing local project to Gitolite
     79SSH knows which key to use depending on which Host alias you reference.
     80
     81== Push an existing local project to Gitolite
    7382
    7483From your project directory:
    7584
     85{{{#!sh
    7686cd ~/projects/myproject
    7787git remote add origin gitolite-mesechannel:airsituation
    78 git push -u origin main
    79 ✅ Your full project history is uploaded.
     88git push
     89}}}
    8090
    81 7. 📥 Clone a repo using different users/keys
     91In case you want to push as admin use
     92
     93{{{#!sh
     94git remote add origin kokyou.dev:airsituation
     95}}}
     96
     97== Clone a repo using different users/keys
    8298
    8399Example:
    84100
     101{{{#!sh
    85102git clone gitolite-mesechannel:airsituation
     103}}}
     104
    86105or
    87106
     107{{{#!sh
    88108git clone gitolite-mesepackager:some-other-repo
     109}}}
     110
    89111depending on which SSH identity you use.
     112
    90113[wiki:Workflows back]