Отправлено Май 26, 2011

Установка gitolite на ubuntu

Быстрый старт с gitolite.

Сделайте ключ SSH public/private

[user@client ~]$ ssh keygen -t rsa

Скопируйте ключ на сервер

[user@client ~]$ scp ~/.ssh/id_rsa.pub user@server.example.org:/tmp/user.pub

Зайдите по SSH на сервер и станьте root

[user@client ~]$ ssh user@server.example.org
user@server:~$ sudo -s

Установите gitolite

root@server:~# apt-get install gitolite

Переключитесь на пользователя gitolite

root@server:~# sudo -u gitolite -i

Запустите начальную установку Gitolite

gitolite@server:~$ gl-setup /tmp/user.pub

С клиентского компьютера склонируйте репозиторий gitolite-admin repository

[user@client ~]$ git clone gitolite@server.example.org:gitolite-admin
Cloning into gitolite-admin...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.

Перейдите в папку gitolite-admin

[user@client ~]$ cd gitolite-admin

Создание репозитория test

[user@client gitolite-admin]$ vim conf/gitolite.conf
[user@client gitolite-admin]$ git commit -a -m "Add test repository"
[user@client gitolite-admin]$ git a
[master 507045a] Add test repository
 1 files changed, 3 insertions(+), 0 deletions(-)
[user@client gitolite-admin]$ git push
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 376 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Already on 'master'
remote: creating test...
remote: Initialized empty Git repository in /var/lib/gitolite/repositories/test.git/
To gitolite@server.example.org:gitolite-admin
   87cc470..507045a  master -> master

Клонирование репозитория test

[user@client ~]$ git clone gitolite@server.example.org:test
Cloning into test...
warning: You appear to have cloned an empty repository.

Добавим файл README

[user@client test]$ echo "Test Repo" > README
[user@client test]$ git commit -a -m "Initial commit"
[master (root-commit) 4a49ee0] Initial commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 README

Отправляем изменения на сервер

[user@client test]$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 218 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To gitolite@server.example.org:test
 * [new branch]      master -> master

Читайте Gitolite wiki для детальной документации.