CentOS Stream 8
Sponsored Link

Git : Gitolite : リポジトリを追加する2021/06/18

 
Gitolite にリポジトリを新規追加します。
[1] 例として [project01] リポジトリを登録します。作業は Gitolite 管理者で実施します。
[gitolite3@dlp ~]$
vi ~/gitolite-admin/conf/gitolite.conf
# 最終行に追記

# Gitolite 登録済みの全ユーザーが読み書き可能

repo project01
    RW      =   @all

[gitolite3@dlp ~]$
cd ~/gitolite-admin

[gitolite3@dlp gitolite-admin]$
git commit -a -m "Add project01 repository"

[master bd3bff0] Add project01 repository
1 file changed, 3 insertions(+)
[gitolite3@dlp gitolite-admin]$
git push

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 397 bytes | 397.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Initialized empty Git repository in /var/lib/gitolite3/repositories/project01.git/
To ssh://GitServer/gitolite-admin
   1ad511f..bd3bff0  master -> master
[2] 任意の Gitolite に登録済みのユーザーで、新規追加したリポジトリが利用できるか動作確認します。
# 現在アクセス可能なリポジトリ一覧表示

[cent@node01 ~]$
ssh GitServer info

hello id_cent, this is gitolite3@dlp running gitolite3 3.6.12-1.el8 on git 2.27.0

 R W    project01
 R W    testing

[cent@node01 ~]$
mkdir mywork

[cent@node01 ~]$
cd mywork

[cent@node01 mywork]$
git config --global user.name "cent"

[cent@node01 mywork]$
git config --global user.email "cent@node01.server.world"

[cent@node01 mywork]$
git clone ssh://GitServer/project01

Cloning into 'project01'...
warning: You appear to have cloned an empty repository.

[cent@node01 mywork]$
total 0
drwxrwxr-x. 3 cent cent 18 Jun 18 01:06 project01
[cent@node01 mywork]$
cd project01
[cent@node01 project01]$
echo testfile1 > testfile1.txt

[cent@node01 project01]$
git add testfile1.txt

[cent@node01 project01]$
git commit -m "initial commit"

[master (root-commit) 5606151] initial commit
 1 file changed, 1 insertion(+)
 create mode 100644 testfile1.txt

[cent@node01 project01]$
git remote -v

origin  ssh://GitServer/project01 (fetch)
origin  ssh://GitServer/project01 (push)

[cent@node01 project01]$
git push origin master

Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 225 bytes | 225.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To ssh://GitServer/project01
 * [new branch]      master -> master

[cent@node01 project01]$
git ls-files

testfile1.txt
関連コンテンツ