Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1149520
  • 博文数量: 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:51:21

Install Gitolite

Nice and easy this part, on the server:

server> sudo apt-get update

server> sudo apt-get install gitolite

Creating a Public/Private key pair

If you already have one, send the public halve over to the server and skip this part. Otherwise, take a look at , then create your key pair on your client machine:

client> ssh-keygen

client> scp ~/.ssh/id_rsa.pub server:davem.pub

Configure gitolite

On the server, copy the public halve to a convenient location and run the gl-setup tool.

server> mv davem.pub /tmp/davem.pub

server> chmod 666 /tmp/davem.pub

server> sudo su gitolite

server> gl-setup /tmp/davem.pub ...

That’s gitolite setup, we now need to go back to the client machine to fully configure it. First edit your .ssh/config file, so that ssh knows how to connect to the server. Again, be careful to use the correct name for your key pair:

Host servername

IdentityFile ~/.ssh/id_rsa

Now we can clone the git repository that is used to configure gitolite:

client> git clone

Initialized empty Git repository in /home/davem/gitolite-admin/.git/

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.

client> cd gitolite-admin

Adding repositories

The gitolite admin contains two folders. The first, conf contains a single config file. Open that and create a new repository by adding:

repo mytest

RW+ = @all

You then need to commit the changes and push them to the gitolite server:

client> git commit -m "Added mytest repo" conf/gitolite.conf

client> git push

We then should be able to clone our new repository:

client> git clone

Adding users

To add a new user, simply add their public key halve to your clone of the gitolite-admin repo, add, commit and push.

client> cd gitolite-admin

client> cp ~/Downloads/another.pub keydir/

client> git add keydir/another.pub

client> git commit -m "Added another as a user" keydir/another.pub

client> git push

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