建立Gitolite ( setting up gitolite server)

访问量: 1667

gitosis 是比较古老的的GIT server。 我今天早上弄了一下,发现官方的文档很不好用啊亲!自己之前成功的搭建过,今天居然不行。搜索了一下,发现官方承认他们文档欠缺,而且网上的声音也认为它失效很久了(long-defunct ) 。大家都用 gitolite 来搭建GIT 服务。而且GITOLITE的GITHUB关注度是 4000+, GITOSIS 400。 所以,我打算用gitolite来做~~~  (gitosis is an old product of git server. This morning I tried to setup a gitosis server, but failed on the last but two steps. I found its official document admits that it's lacking of document and out-of-date. And many posts say that "gitosis" is "defunct" , and let's use gitolite instead. On github, 4000+ people is watching gitolite, but only 400 watching gitosis. ) 

参考1:refer to : http://sitaramc.github.com/3-server-usage/git-server.html   

参考2:refer to : http://engineeredweb.com/blog/10/2/building-your-own-git-server/

1. login as 'git' user.  ( useradd git, then passwd git , then su git ... ) 

2. git clone git://github.com/sitaramc/gitolite

3. git clone git://github.com/sitaramc/gitolite
mkdir -p $HOME/bin
gitolite/install -to $HOME/bin
home/git/bin/gitolite setup -pk YourName.pub

注意:这里的 ssh pub key 绝对不可以有密码。

这时可以看到, gitolite为我们新建了 /home/git/repositories ... 等文件

-rw-rw-r-- 1 git git   12 Feb  9 15:10 projects.list
drwxrwxr-x 4 git git 4096 Feb  9 15:10 repositories

4. 下面的用法跟 gitosis一样, 想加入用户,就进入到gitolite folder,:
  4.1 编辑 conf/gitolite.conf, 加入 
repo foo
  RW+ = alice
  RW = bob
  4.2 把 alice 和 bob 的pub文件 都放到 keydir下。  
  4.3 commit & push. 

5. create new repo:  编辑 config/gitolite.conf, 增加

repo shuashua_printer
    RW+     =   @all

然后 commit & push gitolite-admin , 就可以了。

订阅/RSS Feed

Subscribe

分类/category