CentOS 8
Sponsored Link

Git : Gitolite : アクセス権の設定2020/04/16

 
リポジトリのアクセス権の設定です。作業は Gitolite 管理者で実施します。
[1] 例として、[project01] リポジトリに [cent] ユーザーのみ読み書き権限 (リビジョンを戻す権限含めて) を付与します。
[gitolite3@dlp ~]$
cd ~/gitolite-admin/conf

[gitolite3@dlp conf]$
vi gitolite.conf
# 最終行に追記

# ユーザー名の指定はユーザーの SSH 鍵のファイル名

# [+] 付加で リビジョンを戻す権限も含む

repo project01
    RW+     =   id_cent

[gitolite3@dlp conf]$
git commit -a -m "Change Permission for project01"

[master dd760cb] Change Permission for project01
 1 file changed, 1 insertion(+), 1 deletion(-)
[gitolite3@dlp conf]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 370 bytes | 185.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
To ssh://GitServer/gitolite-admin
   5c805f7..dd760cb  master -> master
[2] 例として、[project02] リポジトリに [developer] グループのみ読み書き権限を付与します。
[gitolite3@dlp ~]$
cd ~/gitolite-admin/conf

[gitolite3@dlp conf]$
vi gitolite.conf
# 最終行に追記

@developer = id_cent id_redhat

repo project02
    RW      =   @developer

[gitolite3@dlp conf]$
git commit -a -m "Change Permission for project02"

[master 8b67ee4] Change Permission for project02
 1 file changed, 5 insertions(+)
[gitolite3@dlp conf]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 438 bytes | 219.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: Initialized empty Git repository in /var/lib/gitolite3/repositories/project02.git/
To ssh://GitServer/gitolite-admin
   dd760cb..8b67ee4  master -> master
[3] 例として、[project03] リポジトリに 以下のようなアクセス権を付与します。
・全ユーザーに読み取り権限
・[id_redhat] は全ブランチに読み書き権限
・[developer2] グループは [develop] ブランチに読み書き権限
・[deployer] グループは [release] ブランチに読み書き権限
[gitolite3@dlp ~]$
cd ~/gitolite-admin/conf

[gitolite3@dlp conf]$
vi gitolite.conf
# 最終行に追記

@developer2 = id_cent id_fedora
@deployer = id_debian id_ubuntu

repo project03
    R           =  @all
    RW          =  id_redhat
    RW develop  =  @developer2
    RW release  =  @deployer

[gitolite3@dlp conf]$
git commit -a -m "Change Permission for project03"

[master 70da8b7] Change Permission for project03
 1 file changed, 8 insertions(+)
[gitolite3@dlp conf]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 494 bytes | 494.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: WARNING: syntax error, ignoring: 'R+ = id_redhat'
remote: Initialized empty Git repository in /var/lib/gitolite3/repositories/project03.git/
To ssh://GitServer/gitolite-admin
   39e981a..70da8b7  master -> master
関連コンテンツ