Currently, we use gitolite to access control our Git repositories. In addition, we use Redmine to manage our projects.
The standard installation of Redmine can only access a local Git repository via direct access to the file system. Unfortunately, Redmine is not able to show Git repositories via the Git protocol. The latter approach is preferable since gitolite allows access to Git repositories via the Git daemon. By using gitolite as intended, Redmine cannot access bare gitolite-controlled repositories because the Redmine user does not have read permissions on the corresponding directories.
Since Version 1.6 Git provides a clone
option to create a bare repository of an existing one. So the first step to let Redmine show a gitolite-controlled repository is to make a mirror clone of it in a directory that Redmine can access, for instance in /var/git-mirrors
$ git clone --mirror /home/git/repositories/my-repo.git
Since the git
user will keep the two repositories via post-receive
hook in sync, git
needs to have read/write permissions on the mirror clone:
$ cd /var/git-mirrors/
$ chown -R git:git my-repo.git
To keep the repositories in sync, you need to install a post-receive
hook in the gitolite-controlled repositories that mirror-pushes each change to the mirror repository in /var/git-mirrors
:
$ cd /home/git/repositories/my-repo.git/hooks
$ cat >> post-receive << EOF
> #!/bin/sh
> /usr/bin/git push --mirror /var/git-mirrors/my-repo.git
> EOF
$ chown git:git post-receive
$ chmod 700 post-receive
When Git mirror-pushes changes to a repository, it keeps the file/directory permissions from the mirrored repository. Since gitolite maintains the repositories, only the owner of the repository has read and write access. After a mirror-push, the mirror repository cannot by read by anyone else anymore. Therefore, you have to tell the mirror repository that its shared and what file/directory permission it should have:
$ cd /var/git-mirrors/my-repo.git
$ git config --add core.sharedRepository 0644
That’s it. You should be able to integrate the bare mirror repository /var/git-mirrors/my-repo.git
into Redmine and keep it automatically in sync whenever you push to the gitolite-controlled, original repository.
原文转自:http://ambitz.com/2011/03/07/adding-a-gitolite-controlled-repository-to-redmine/
分享到:
相关推荐
Adding white noise to a signal with fixed SNR
在Linux操作系统中,系统调用是用户空间与内核空间交互的主要途径,它们提供了一种安全、高效的方式,使得应用程序可以访问操作系统的核心功能。本文档将深入探讨如何在Linux内核中添加一个新的系统调用,这是一项...
标题中的“instructions-for-adding-your-logo.pdf”暗示了这是一个关于如何在PDF文件中添加徽标的指南。PDF(Portable Document Format)是一种广泛使用的文档格式,它能够保持文档的原始布局和设计,不受操作系统...
Chapter 8: Make Secret Messages a Phone App to Share with Friends! Chapter 9: Paint Colorful Bubbles with Your Mouse! Chapter 10: Adding Animation and Collision Detection with Timers Chapter 11: ...
在本项目"week-3-groceries-adding-remove-items-thanhthanhbui"中,我们探讨的是一个基于TypeScript的编程练习,旨在提升开发者在实际应用中的编程技能。TypeScript是JavaScript的一个超集,提供了静态类型系统、类...
在现代的Web应用中,音频元素的集成已经成为增强用户体验的重要组成部分。"tutsplus-将声音添加到您的网络应用程序"这个教程将引导你通过使用JavaScript技术来实现这一目标。JavaScript,作为Web开发中的核心技术,...
Ns-3-Adding-text-in-packets 将真实文本数据添加到 ns-3 数据包中。 座右铭是成功地将真实数据从一个节点发送到另一个节点。这已在 ns-3 中的三个示例中实现。 代码执行的先决条件: 将安装 ns-3。 安装后,...
在本课程"FEWD-unit4-adding-3d-effects-with-css:树屋FEWD单元4"中,我们将深入探讨如何利用CSS(Cascading Style Sheets)来创建令人惊叹的3D效果。CSS作为网页设计的核心技术之一,允许我们对网页元素进行布局、...
在IT行业中,"TA-STYLE-adding-media-THaaai" 这个标题可能指的是一个项目或教程,它聚焦于如何在某个特定的平台或应用(可能是网站、应用程序或者游戏)上添加媒体资源,比如图像、音频和视频,以增强用户体验。...
标题“Taking the pain out of adding a horizontal scrollbar to a listbox”指向的就是这样一个问题:如何优雅地为列表框添加水平滚动条,以提升用户体验。这里我们将详细探讨这个主题,并提供一些实践技巧。 ...
Lab4向聊天机器人添加发现 这是Coursera上使用Watson API构建AI应用程序课程的实验室和Capstone项目的源代码。 相关文件: Watson Assistant服务概述 Watson Discovery Service概述 沃森发现如何构建查询 ...
自动将产品添加到购物车 您可以将购物车设置为自动包含产品作为礼物。 当任何其他项目添加到空购物车时,... 单击Snippets文件夹,然后单击Add a new snippet 。 将您的代码段命名为“ cart-add-on ,然后单击“创建
开源项目-gomatic-extender.zip,Go toolchain subcommand extender - allows for easily adding to or overriding go subcommands by just adding a go-* executable to the path.
USB4 1.0工程变更通知(Engineering Change Notice,ECN)主要涉及的是在特定情况下关闭RS-FEC(Reed-Solomon Forward Error Correction)编码的功能。RS-FEC是一种用于纠正数据传输过程中可能出现错误的编码技术,...
Indoor TD-LTE Small Cell Deployment Study:Benefit of Adding Cells is Not Always Existing
【标题】"用CodeSandbox创建boolean-uk-html-adding-the-rest"是一个关于在Web开发环境中使用CodeSandbox实现HTML相关功能的项目。这个标题暗示我们将深入探讨如何利用在线代码编辑器CodeSandbox来处理布尔逻辑...
本课程“Adding-Event-Handlers_lesson”聚焦于如何有效地使用事件处理程序,特别是JavaScript中的`addEventListener()`方法。这个方法是DOM(文档对象模型)级别2中的一个功能,用于将一个或多个事件处理器添加到...
标题 "newhtml-adding-css-and-darkmode" 暗示了这是一个关于HTML项目,特别是涉及到CSS(层叠样式表)的增强,可能还包含了暗黑模式(Dark Mode)的实现。这个项目提供源代码,意味着我们可以深入理解CSS如何应用于...