CentOS 8
Sponsored Link

Git : Gitolite : Add Repositories2020/04/16

Add New Repository in Gitolite.
[1] For exmaple, add a new repository [project01]. Work with Gitolite admin user.
[gitolite3@dlp ~]$
vi ~/gitolite-admin/conf/gitolite.conf
# add to the end

# all users in Gitolite can read/write

repo project01
    RW      =   @all

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

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

[master 5c805f7] 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 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 393 bytes | 393.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: Initialized empty Git repository in /var/lib/gitolite3/repositories/project01.git/
To ssh://GitServer/gitolite-admin
   7abcbef..5c805f7  master -> master
[2] Verify to access to the repository added above with a user in Gitolite.
# list available repositories for this user

[cent@node01 ~]$
ssh GitServer info

hello id_cent, this is gitolite3@dlp running gitolite3 3.6.11-5.el8 on git 2.18.2

 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 Apr 15 19:58 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) 92ffffb] 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), 224 bytes | 224.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://GitServer/project01
 * [new branch]      master -> master
[cent@node01 project01]$
git ls-files

Matched Content