登陆redmine,新建project,在配置中的版本库下的SCM中选择git,输入git的路径即可,如下图所示:



我们使用gitolite来管理我们的版本库,使用redmine来管理我们的工程,然而标准安装的redmine只能访问本地版本库,redmine不能通过git协议访问git版本库,但是1.6版本的git提供了clone命令,对已经存在的版本库创建一个bare版本库。  

在git下新建目录yuzhanwu,并将生成的镜像文件放到该目录,

mkdir yuzhanwu

cd yuzhanwu

git clone --mirror /home/git/repositories/test.git

找到生成的镜像文件,

cd yuzhanwu

chown -R git:git test.git

然后继续下面的过程

cd /home/git/repositories/test.git/hooks/

cat>>post-receive<<EOF

>#!/bin/sh

>/usr/bin/git push --mirror /home/git/yuzhanwu/test.git

>EOF

chown -R git:git post-receive

chmod 700 post-receive

然后继续下面过程

cd /home/git/yuzhanwu/test.git

git config --add core.sharedRepository 0644

这样就配置好了,我们可以将/home/git/yuzhanwu/test.git放到redmine中即可。

假如repo已经存在的情况下我还没有解决,继续探索中,目前我的解决办法只是重新建版本库,然后继续上面操作。

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐