首页 > 其他分享 >Adding a gitolite-controlled repository to Redmine

Adding a gitolite-controlled repository to Redmine

时间:2023-08-27 12:05:04浏览次数:41  
标签:Adding git repository repositories gitolite Redmine mirror


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.

 


标签:Adding,git,repository,repositories,gitolite,Redmine,mirror
From: https://blog.51cto.com/u_16237557/7252129

相关文章

  • C# 实现 国密SM4/ECB/PKCS7Padding对称加密解密
    C# 实现国密SM4/ECB/PKCS7Padding对称加密解密,为了演示方便本问使用的是VisualStudio2022来构建代码的1、新建项目,之后选择项目鼠标右键选择 管理NuGet程序包管理,输入 BouncyCastle回车添加BouncyCastle程序包 2、代码如下:CBC模式byt......
  • Java 实现 国密SM4/ECB/PKCS7Padding对称加密解密
    Java实现国密SM4/ECB/PKCS7Padding对称加密解密,为了演示方便本问使用的是IntelliJIDEA2022.1(CommunityEdition)来构建代码的1、pom.xml文件添加需要的jar<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"......
  • ZeroPadding 参照
      加密时要处理。解密时,不需要额外处理,直接NoPadding. importsun.misc.BASE64Decoder;importsun.misc.BASE64Encoder;importjavax.crypto.Cipher;importjavax.crypto.spec.IvParameterSpec;importjavax.crypto.spec.SecretKeySpec;importjava.nio.charset.St......
  • springmvc 开启异步请求报错 Java code using the Servlet API or by adding "true"
    报错内容:java.lang.IllegalStateException:Asyncsupportmustbeenabledonaservletandforallfiltersinvolvedinasyncrequestprocessing.ThisisdoneinJavacodeusingtheServletAPIorbyadding"true"toservletandfilterdeclarationsin......
  • [机器学习]对transformer使用padding mask
    注:本文是对GPT4的回答的整理校正补充。在处理序列数据时,由于不同的序列可能具有不同的长度,我们经常需要对较短的序列进行填充(padding)以使它们具有相同的长度。但是,在模型的计算过程中,这些填充值是没有实际意义的,因此我们需要一种方法来确保模型在其计算中忽略这些填充值。这就是p......
  • AES加密 flutter java后台用的 AES/CBC/PKCS5Padding
     可测试AES是否正确的网址https://www.toolhelper.cn/SymmetricEncryption/AES java后台代码如下publicstaticStringencrypt(StringclearText,Stringkey,Stringiv){byte[]result=null;try{byte[]key_bytes=toByte(MD5Util......
  • Sprite padding, innerUV, outerUV的解释
    1)Rectrect;SpriteMode为Single时:x,y总是为0;width,height为裁掉空白像素前的大小2)Vector2textureRectOffset;左下角裁掉了多少空白像素3)RecttextureRect;x,y为Sprite左下角的坐标(图集左下角为原点);width,height为裁掉空白像素后的大小4)Vector4paddin......
  • android:padding="15dp
    Android中的padding属性解析在Android开发中,我们经常会使用到布局文件来定义界面的结构和外观。其中,android:padding属性是一个非常常见的属性之一,用于设置控件的内边距。本篇文章将为大家介绍android:padding属性的使用方法以及相关知识点。1.android:padding属性的作用androi......
  • 3. Q_ 对内联元素设置_padding_top_和_padding_bottom_是否会增加它的
    Q:对内联元素设置padding-top和padding-bottom是否会增加它的高度?(原题是Doessettingpadding-topandpadding-bottomonaninlineelementaddtoitsdimensions?)A:答案是不会。同上题比较纠结,不太明白这里的dimensions指的是到底是什么意思?放置一边,咱们来分析下。对于......
  • TreeSaver 使用教程整理——Step 2: Adding Basic UI
    请首先阅读前一篇教程:TreeSaver使用教程整理——Step1:GettingStartedStep2:AddingBasicUI我们上一步实现的网页有了一个最最简单的功能,这一步我们将在上一步基础上添加切换分页的按钮以及显示当前页面信息。请Copy上一步的内容,并对下面文件做如下修改: 对资源文件(resource......