嵌入式 ubuntu上配置git服务器

原创 2013年12月02日 14:44:18

     需求

硬件需求:一台Ubuntu或者debian电脑(虚拟机),能通过网络访问到。

软件需求:git-core, gitosis,openssh-server, openssh-client

     安装配置git服务器

安装git和openssh:

a@server:~$ sudo apt-get install git-coreopenssh-serveropenssh-client

新加用户git,该用户将作为所有代码仓库和用户权限的管理者:

a@server:~$ sudo useradd -m git

a@server:~$ sudo passwd git

建立一个git仓库的存储点:

a@server:~$ sudo mkdir /home/repo

让除了git以外的用户对此目录无任何权限:

a@server:~$ sudo chown git:git /home/repo

a@server:~$ sudo chmod 755/home/repo   注:此处要把git仓库repo的属性设置成755,不然在gitweb中一直无法找到工程

     安装配置gitosis

初始化一下服务器的git用户,这一步其实是为了安装gitosis做准备。在任何一 台机器上使用git,第一次必须要初始化一下:

a@server:~$ git config –global user.name“myname”

a@server:~$ git config –global user.email“myname@server“

安装一下python的setup tool, 这个也是为了gitosis做准备:

a@server:~$ sudo apt-get installpython-setuptools

获得gitosis包:

a@server:~$ cd /tmp

a@server:/tmp$ git clone git://eagain.net/gitosis.git

a@server:/tmp$ cd gitosis

a@server:/tmp/gitosis$ sudo python setup.pyinstall

切换到git用户下:

a@server:/tmp/gitosis$ su git

默认状态下,gitosis会将git仓库放在 git用户的home下,所以我们做一个链接到/home/repo

$ ln -s /home/repo /home/git/repositories

再次返回到默认用户

$ exit

如果你将作为git服务器的管理员,那么在你的电脑上(另一台pc)生成ssh公钥:

usr@pc1:~$ ssh-keygen -t rsa

将公钥拷贝到服务器的/tmp下:

usr@pc1:~$ scp .ssh/id_rsa.pubgit@:/tmp<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">回到git服务器上<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">a@server:/tmp/gitosis$ sudo chmoda+r/tmp/id_rsa.pub<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">让gitosis运行起来:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">a@server:/tmp/gitosis$ sudo -H -u gitgitosis-init </tmp/id_rsa.pub<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">Initialized empty Git repositoryin/home/repo/gitosis-admin.git/<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">Reinitialized existing Git repositoryin/home/repo/gitosis-admin.git/<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">gitosis的有趣之处在于,它通过一个git仓库来管理配置文件,仓库就放在了/home/repo/gitosis-admin.git。我们需要为一个文件加上可执行权限:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">a@server:/home/git$ sudo passwd root<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">a@server:/home/git$ su<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">root@server:/home/git# cd repositories<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">root@server:/home/git/repositories#cdgitosis-admin.git/<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">root@server:/home/git/repositories/gitosis-admin.git#sudochmod 755 /home/repo/gitosis-admin.git/hooks/post-update<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">root@server:/home/git/repositories/gitosis-admin.git#exit<\/P><H1 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none"name=t3><\/A>4      在服务器上新建一个测试项目仓库<\/H1><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">我们在服务器上新建一个空的项目仓库,叫“teamwork”。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">切换到git用户:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">a@server:/home/git$ su – git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ cd/home/repo<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ mkdirteamwork.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ cdteamwork.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ git init- -bare     <SPAN style="COLOR: rgb(255,0,0)"><FONTface=Arial>注:这是在服务器上运行的,是为了初始化一个根级的git仓库<\/FONT><\/SPAN><\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$exit<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">但是,到目前为止,这只是一个空仓库,空仓库是不能clone下来的。为了能做clone,我们必须先让某个有权限的人放一个初始化的版本到仓库中。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">所以,我们必须先修改一下gitosis-admin.<\/P><H1 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none"name=t4><\/A>5      管理gitosis的配置文件<\/H1><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">刚刚提到,gitosis本身的配置也是通过git来实现的。在你自己的开发机里,把gitosis-admin.git这个仓库clone下来,就可以以管理员的身份修改配置了。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">在你的电脑里:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work$ gitclonegit@<server>:gitosis-admin.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work$ cd gitosis-admin/<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">该目录下的keydir目录是用来存放所有需要访问git服务器的用户的ssh公钥:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">各个用户按照前面提到的办法生成各自的ssh公钥文件后,把所有人的ssh公钥文件都拿来,按名字命名一下,比如b.pub,lz.pub等,统统拷贝到keydir下:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/gitosis-admin$ su root<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">root@pc1:/home/a/work/gitosis-admin#cp/path/to/.ssh/id_rsa.pub ./keydir/b.pub<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">root@pc1:/home/a/work/gitosis-admin#exit<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">修改gitosis.conf文件,我的配置大致如下:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">[gitosis]<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">[groupgitosis-admin]<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">writable =gitosis-admin<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">members =a@server usr@pc1<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">[grouphello]<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">writable =teamwork<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">members =a@server b<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">[grouphello_ro]<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">readonly =teamwork<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">members =lz<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">这个配置文件表达了如下含义:gitosis-admin组成员有a,usr,该组对gitosis-admin仓库有读写权限;<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">team组有a,b两个成员,该组对teamwork仓库有读写权限;<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">team_ro组有lz一个成员,对teamwork仓库有只读权限。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">当然目前这些配置文件的修改只是在你的本地,你必须推送到远程的gitserver上才能真正生效。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">加入新文件、提交并push到git服务器:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/gitosis-admin$ git add .<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/gitosis-admin$ git commit-am “add teamweokprj and users”<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/gitosis-admin$ git pushoriginmaster<\/P><H1 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none"name=t5><\/A>6      初始化测试项目<\/H1><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">好了,现在服务器就搭建完了,并且有一个空的项目teamwork在服务器上。接下来呢?当然是测试一下,空仓库是不能clone的,所以需要某一个有写权限的人初始化一个版本。就我来做吧,以下是在客户端完成。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work$ mkdir teamwork-ori<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work$ cd teamwork-ori/<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ git init        <FONT face=Arial><SPANclass=Apple-converted-space> <\/SPAN><SPANstyle="COLOR:rgb(255,0,0)">注:这是在用户端的PC上执行的,为的是初始化一个本地的版本库<\/SPAN><\/FONT><\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ echo “” > hello<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ git add .<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ git commit -am“initialversion”<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ git remote addorigingit@<server>:teamwork.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ git pushoriginmaster<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">到此为止teamwork已经有了一个版本了,team的其他成员只要先clone一下teamwork仓库,就可以任意玩了。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">usr@pc1:~/work/teamwork-ori$ su b<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ cd/home/b<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ gitclone git@<server>:teamwork.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ cdteamwork<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ vimhello<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ git add.<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ gitcommit -am “b add”<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ git pushorigin master<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$exit<\/P><H1 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none"name=t6><\/A>7      添加已有git项目<\/H1><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">另外:如果你有一个现成的git仓库,想放到gitserver上供team使用(比如你clone了一个官方的kernel仓库,想在内部使用它作为基础仓库),怎么办呢。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">首先需要从你的工作仓库中得到一个纯仓库, 比如你的工作目录为~/kernel,你想导出纯仓库到你的优盘里,然后拷贝到gitserver上去。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$ gitclone –bare ~/kernel /media/udisk<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">然后就拿着优盘,交给gitserver的管理员,让他拷贝到/home/repo/下,同时需要配置gitosis相关配置文件哦,这个就不用再说了吧。比如:下载ALSA库:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">gitclonegit://android.git.kernel.org/platform/external/alsa-lib.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">git clonegit://android.git.kernel.org/platform/external/alsa-utils.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">生成bare库<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">git clone–bare alsa-lib alsa-lib.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">git clone–bare alsa-utils alsa-utils.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">将bare库移动到git服务器目录<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">cpalsa-lib.git /home/repo<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">注意变更所有者,以获取提交权限。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">chown -Rgit alsa-lib.git<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">然后就O了,呵呵.<\/P><H1 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none"name=t7><\/A>8      创建gitweb<\/H1><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">sudoapt-get install gitweb<\/P><H2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none" name=t8><\/A>8.1配置 gitweb<\/H2><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">默认没有 css加载,把 gitweb 要用的静态文件连接到DocumentRoot 下:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">cd/var/www/<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">sudo ln -s/usr/share/gitweb/* .<\/P><H2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none" name=t9><\/A>8.2修改配置<\/H2><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">sudo vi/etc/gitweb.conf<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">将$projectroot改为git仓库存储目录(例如:/home/git/repositories),保存后刷新浏览器。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">如果没有找到项目,你需要将$projectroot/*.git的属性改为755,让apache用户有可读权限。可以只改你需要让别人通过web访问的那个git。http://localhost/cgi-bin/gitweb.cgi<\/P><H2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none" name=t10><\/A>8.3修改/etc/gitweb.conf 内容<\/H2><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"># path togit projects(<project>.git)<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">#$projectroot = "/var/cache/git";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">$projectroot ="/home/git/repositories";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">#directory to use for temp files<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$git_temp= "/tmp";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"># targetof the home link on top of allpages<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$home_link= $my_uri || "/";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"># htmltext to include at home page<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$home_text= "indextext.html";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"># filewith project list; by default,simply scan the projectrootdir.<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">$projects_list = $projectroot;<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">#stylesheet to use<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">@stylesheets =("/gitweb/static/gitweb.css");<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">#javascript code for gitweb<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">$javascript ="gitweb/static/gitweb.js";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"># logo touse<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$logo="/gitweb/static/git-logo.png";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"># the'favicon'<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">$favicon="/gitweb/static/git-favicon.png";<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">#git-diff-tree(1) options to use forgenerated patches<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">#@diff_opts = ("-M");<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">@diff_opts= ();<\/P><H2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none" name=t11><\/A>8.4配置apache2<\/H2><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">ubuntu中默认的web目录是/var/www,默认的cgi目录是/usr/lib/cgi-bin/,安装完成gitweb后,gitweb的gitweb.cgi会自动放置到该目录下。<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">如果你的cgi路径不是默认的/usr/lib/cgi-bin/,需要将gitweb安装在/usr/lib/cgi-bin中的gitweb.cgi复制到原来配置的cgi-bin路径,并在apache的配置文件/etc/apache2/apache.conf末尾加上以下内容:<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">SetEnv GITWEB_CONFIG  /etc/gitweb.conf<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px"><Directory"/srv/www/cgi-bin/gitweb">          <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    OptionsFollowSymlinksExecCGI         <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    Allowfromall                         <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    AllowOverrideall                      <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    Orderallow,deny                       <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    <Filesgitweb.cgi><\/P><SPAN style="DISPLAY: inline!important; FLOAT: none; WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">SetHandlercgi-script<\/SPAN><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    <\/Files>                   <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    RewriteEngineon<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    RewriteCond%{REQUEST_FILENAME} !-f<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    RewriteCond%{REQUEST_FILENAME} !-d<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">    RewriteRule^.* /gitweb.cgi/$0 [L,PT]<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px"><\/Directory><\/P><H2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;PADDING-BOTTOM: 0px; MARGIN: 0px; WORD-SPACING: 0px;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;LINE-HEIGHT: 26px; PADDING-TOP: 0px; FONT-STYLE: normal;FONT-FAMILY: Arial; WHITE-SPACE: normal; LETTER-SPACING: normal;BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; FONT-VARIANT:normal; webkit-text-size-adjust: auto; orphans: 2; widows: 2;webkit-text-stroke-width: 0px"><A style="COLOR:rgb(51,102,153); TEXT-DECORATION: none" name=t12><\/A>8.5重新启动apache<\/H2><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px">sudo/etc/init.d/apache2 restart<\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width:0px">访问http://localhost/cgi-bin/gitweb.cgi <\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"><SPANstyle="COLOR: rgb(255,0,0)"><FONTface=Arial>说明一点:如果其它新加入的成员无法clone一个git仓库时,如出现如下错误提示:<\/FONT><\/SPAN><\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"><SPANstyle="COLOR: rgb(255,0,0)"><FONTface=Arial>ERROR:gitosis.serve.main:Repository read accessdenied <\/FONT><\/SPAN><\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"><SPANstyle="COLOR: rgb(255,0,0)"><FONTface=Arial>原因是当前成员的key命名与在gitosis.conf中的members中的名字不一致!例如所用的key名是lxq_rsa.pub,而在gitosis.conf中某一group下所用的名称为lxq@ubuntu<\/FONT><\/SPAN><\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"><SPANstyle="COLOR: rgb(255,0,0)"><FONTface=Arial>则只需要把lxq_rsa.pub重命名为lxq@ubuntu.pub并重新push到服务器上即可!<\/FONT><\/SPAN><\/P><P style="WORD-SPACING: 0px; FONT: 14px/26px Arial;TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px;WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR:rgb(255,255,255); TEXT-ALIGN: left; webkit-text-size-adjust: auto;orphans: 2; widows: 2; webkit-text-stroke-width: 0px"><SPANstyle="COLOR: rgb(255,0,0)"><FONTface=Arial>最后奉上一个git学习网站,中文的哦 ^_^<\/FONT><Astyle="COLOR: rgb(51,102,153); TEXT-DECORATION: none"href="http://progit.org/book/zh/index.html"><FONTface=Arial>http://progit.org/book/zh/index.html<\/FONT><\/A><\/SPAN><\/P><BRclass=Apple-interchange-newline>

相关文章推荐

Ubuntu16.04安装配置嵌入式交叉编译工具链arm-linux-gcc

(Linux)Ubuntu16.04下安装、配置嵌入式交叉编译工具arm-linux-gcc.4.4.3

Ubuntu12下嵌入式Qt开发环境配置总结

本文以友善之臂的Mini6410嵌入式开发板为目标板,介绍ubuntu 12.04系统下,配置嵌入式Qt开发工具的过程。...

嵌入式环境搭建之基于Ubuntu 14.04下NFS安装配置

一、NFS服务简介   NFS 是Network File System的缩写,即网络文件系统。一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布。功能是通过网络让不同的机器、不...

Ubuntu下嵌入式Qt开发环境配置全攻略

本文以友善之臂的Mini6410嵌入式开发板为目标板,介绍ubuntu 12.04系统下,配置嵌入式Qt开发工具的过程。本文中介绍的工具、大部分步骤和脚本来自开发板附带资料光盘,但其默认配置环境为...
  • judyge
  • judyge
  • 2015年10月26日 10:40
  • 406

Ubuntu 配置Eclipse 导入工程完整设置 嵌入式工具链的安装

配置Eclipse 导入工程完整设置 嵌入式工具链的安装 背景:很长一段时间以来一直在用Ubuntu的13.10版本,发现在使用的过程中系统经常会出现意外问题,经常报错等等,前几个月发现ubunt...
  • LMDeda
  • LMDeda
  • 2015年07月30日 11:15
  • 1298

嵌入式环境:配置NFS服务器

NFS概述 NFS(Network File System)是一种分布式文件系统,允许网络中的安装不同操作系统的计算机间共享文件和外设,所以它的通讯协定设计与主机及作业系统无关. 它是由SUN公司...

嵌入式服务器端配置tftpd

TFTP一般用于向目标板下载镜像文件 TFTP是用来下载远程文件的最简单网络协议,它基于UDP协议而实现。嵌入式linux的tftp开发环境包括两个方面:一是linux服务器端的tftp-server...

嵌入式FTP服务器的移植与配置:VSFTPD-2.0.6移植

主要利用Host上的配置,得到相应的依赖关系。 环境:      Linux-2.6.20 arm-linux-gcc-3.4.1 vsftpd_2.0.6 本来感觉很简...

嵌入式FTP服务器的移植与配置(1):VSFTPD-2.0.6移植

据我了解,FTP服务器vsftpd,proftpd,pureftpd等。考虑到我的CentOS4.5上装的是vsftpd,而且vsftpd很小,但功能还是比较强大。从网上搜索资料,发现该ftp服务器的...

嵌入式web服务器lighttpd的交叉编译及配置(for arm-linux)

嵌入式web服务器lighttpd的交叉编译及配置(for arm-linux)   备注: PC Linux:Ubuntu-10.10 PC Linux用户:root ...
  • yi412
  • yi412
  • 2015年05月19日 16:49
  • 1295
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:嵌入式 ubuntu上配置git服务器
举报原因:
原因补充:

(最多只允许输入30个字)