Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1172439
  • 博文数量: 312
  • 博客积分: 12522
  • 博客等级: 上将
  • 技术积分: 3376
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-27 18:35
文章分类

全部博文(312)

文章存档

2016年(3)

2015年(1)

2013年(1)

2012年(28)

2011年(101)

2010年(72)

2009年(13)

2008年(93)

分类: IT业界

2011-08-28 18:50:21

Setup Gitolite on Ubuntu (Maverick)

Below is a quick guide to installing on Ubuntu.

  1. Create an SSH public/private key pair

    [user@client ~]$ ssh keygen -t rsa
  2. Upload the public key to the server

    [user@client ~]$ scp ~/.ssh/id_rsa.pub user@server.example.org:/tmp/user.pub
  3. SSH to the server and become root

    [user@client ~]$ ssh user@server.example.orguser@server:~$ sudo su -
  4. Install gitolite

    root@server:~# apt-get install gitolite
  5. Switch to the gitolite user

    root@server:~# su - gitolite
  6. Run the Gitolite setup script

    gitolite@server:~$ gl-setup /tmp/user.pub
  7. From your client computer clone the 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.
  8. Switch to the gitolite-admin directory

    [user@client ~]$ cd gitolite-admin
  9. Create a test repository

    [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 pushCounting 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
  10. Clone the test repository

    [user@client ~]$ git clone gitolite@server.example.org:testCloning into test... 
    warning
    : You appear to have cloned an empty repository.
  11. Add a README file to the test repository

    [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
  12. Push the changes to the server

    [user@client test]$ git push origin masterCounting 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

Check out the Gitolite for more documentation.

阅读(944) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~