Redmine 和 Git 集成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2797774/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Redmine & Git integration
提问by user336307
I am considering moving from svn and Trac to git and Redmine. I'm just wondering what everyone's experience is of this. How well does git integrate with Redmine?
我正在考虑从 svn 和 Trac 转移到 git 和 Redmine。我只是想知道每个人的经验是什么。git 与 Redmine 的集成度如何?
I'm pretty set on my decision to change from svn to git - our distributed work, and need to frequently branch and merge would make life considerably easier with git. But we would possibly need to split things into multiple projects for this. From what I have been reading, git and multiple projects don't integrate too smoothly with Trac. That aside, in my investigations into git, Redmine has also caught my attention, and some of the features look very useful.
我决定从 svn 更改为 git - 我们的分布式工作,并且需要经常分支和合并将使 git 的生活变得更加轻松。但是我们可能需要为此将事情分成多个项目。从我所读到的内容来看,git 和多个项目与 Trac 的集成并不太顺利。除此之外,在我对 git 的调查中,Redmine 也引起了我的注意,其中一些功能看起来非常有用。
However, I haven't found as many user experiences of git and Redmine as what I'd like (possibly due to my lack of searching skills...) and so would like to hear your opinions and examples.
但是,我还没有找到像我想要的那样多的 git 和 Redmine 用户体验(可能是由于我缺乏搜索技能......),所以想听听你的意见和例子。
回答by Makis
I built a system last year which used Gitoriousand Redmine. You can integrate git directly with Redmine, no problems there but I would strongly suggest you have a look at Gitorious as well as the tool to control your repositories and follow their events. It can also be used to control access to the repositories etc.
去年我构建了一个系统,它使用了Gitorious和 Redmine。您可以将 git 直接与 Redmine 集成,没有问题,但我强烈建议您查看 Gitorious 以及控制存储库和跟踪其事件的工具。它还可用于控制对存储库等的访问。
Integrating Gitorious and Redmine is pretty simple. I wrote a script that unhashes the Gitorious paths. They are saved in the file system hashed when you use Gitorious so linking those repositories to Redmine would be a bit complex otherwise. My script makes links to those repositories in a much more readable format so linking them to Redmine is really simple, and only required once when you create the project. You can find the script here.
集成 Gitorious 和 Redmine 非常简单。我写了一个脚本来解散 Gitorious 路径。当您使用 Gitorious 时,它们保存在散列的文件系统中,因此将这些存储库链接到 Redmine 会有点复杂,否则。我的脚本以更易读的格式链接到这些存储库,因此将它们链接到 Redmine 非常简单,并且只在创建项目时需要一次。您可以在此处找到该脚本。
Basically you don't need to worry about the integration a lot since Redmine supports git out-of-box - sort of. Of course you need to have the git service running on the server where you "production" repositories are (those that you link to Redmine, do your automated tests etc), but this is also solved with Gitorious.
基本上你不需要担心集成,因为 Redmine 支持 git 开箱即用 - 有点。当然,您需要在“生产”存储库所在的服务器上运行 git 服务(您链接到 Redmine 的那些,进行自动化测试等),但这也可以通过 Gitorious 解决。
I actually wrote my Bachelor's thesis about this issue. It's already slightly outdated since both Gitorious and Redmine have developed a lot, but I could make it available if you want to read it. The thesis explains what needs to be done (some of the problems have already been solved by the two tools) and it also includes a continuous integration environment which automatically builds packages when users push changes to the repositories and puts them into a reprepro repository where testers etc. can easily download them with a web browser.
我实际上写了关于这个问题的学士论文。由于 Gitorious 和 Redmine 已经开发了很多,它已经有点过时了,但是如果您想阅读它,我可以提供它。论文解释了需要做什么(一些问题已经被两个工具解决了),它还包括一个持续集成环境,当用户将更改推送到存储库时,它会自动构建包,并将它们放入测试人员所在的 reprepro 存储库中等可以使用网络浏览器轻松下载它们。
Redmine had some issues last year, especially the lack of sub-projects was a bit annoying but that has been rectified in the 0.9 version. Also the plug-ins should be tested well before taken into production use, some just don't mix well and some don't work at all (probably a clash of Redmine version vs. plug-in version). All in all, though, Redmine works pretty well and should be easily expandable to your needs. Support for Gitorious is superb, for Redmine a bit more sporadic (damn French?) but both tools have large enough user bases that they should be safe bets.
Redmine 去年有一些问题,尤其是缺少子项目有点烦人,但在 0.9 版本中已得到纠正。此外,插件在投入生产使用之前应该进行良好的测试,有些不能很好地混合,有些根本不起作用(可能是 Redmine 版本与插件版本的冲突)。不过,总而言之,Redmine 运行良好,应该可以轻松扩展以满足您的需求。对 Gitorious 的支持是极好的,而 Redmine 的支持有点零星(该死的法语?),但这两种工具都有足够大的用户群,应该是安全的赌注。
Git is a very good version control tool especially for agile teams. It takes some learning and you should write a guide on how to use it for your developers to get the most out of it, but once you learn it, it's extremely productive. We wrote our own which just states the normal working process. Branching, merging etc. should be explained, for instance working on your personal repository's master branch is not such a good idea. Always create a branch and work there. When you pull changes to your master branch from some other repository, it's easier to handle the merging this way - and you won't accidentally push something you didn't mean to.
Git 是一个非常好的版本控制工具,尤其适用于敏捷团队。这需要一些学习,您应该编写一份关于如何使用它的指南,让您的开发人员充分利用它,但是一旦您学会了它,它就会非常高效。我们自己写的,只是说明了正常的工作流程。应该解释分支、合并等,例如在您的个人存储库的主分支上工作不是一个好主意。始终创建一个分支并在那里工作。当您从某个其他存储库向 master 分支拉取更改时,以这种方式处理合并会更容易 - 并且您不会意外地推送您不想要的东西。
回答by Larry Cai
it is a great match due to flexibility in those nice two platform
由于这两个平台的灵活性,这是一个很好的匹配
Integration Setup
集成设置
- setup official git repository (master) in another place using gitolite or gerrit for easy administration, since redmine doesn't provide those functionality for git
- run simple cron job to sync master git repo to redmine git repo as readonly mode
- 使用 gitolite 或 gerrit 在另一个地方设置官方 git 存储库(主)以便于管理,因为 redmine 不为 git 提供这些功能
- 运行简单的 cron 作业以将 master git repo 同步到 redmine git repo 作为只读模式
Integration usage of both
两者的集成使用
- automatically see the relation with issues with git commit
- automatically control the issue with git commit
- 自动查看与 git commit 问题的关系
- 使用 git commit 自动控制问题
please take a look at my blogs ALM – From requirement to implementation and deploymentand ALM – redmine integration with git, well done
请查看我的博客ALM – 从需求到实施和部署以及ALM – redmine 与 git 的集成,做得好
Anyway I am happy with the integration.
无论如何,我对整合感到满意。
limited support for multi git repositories
对多 git 存储库的有限支持
One thing I noticed is it can't support multi git repositories, see feature http://www.redmine.org/issues/779
我注意到的一件事是它不能支持多 git 存储库,请参阅功能http://www.redmine.org/issues/779
Also when you setup the git repository for first time, it can't be changed, be aware of this
此外,当您第一次设置 git 存储库时,它无法更改,请注意这一点
回答by RJD22
Hello I wrote a guide for this some time ago. The guide installs a clean git and a clean redmine. No other extra software needed. It even lets you handle accounts within redmine though http git.
你好,我前段时间为此写了一个指南。该指南安装了一个干净的 git 和一个干净的 redmine。不需要其他额外的软件。它甚至可以让您通过 http git 在 redmine 中处理帐户。
You can find it here: http://codersopinion.com/blog/install-redmine-with-automated-git-on-centos-redhat/
你可以在这里找到它:http: //codersopinion.com/blog/install-redmine-with-automated-git-on-centos-redhat/
Because I wrote this guide a while ago the versions might not match but it should still work with current versions.
因为我不久前写了这个指南,版本可能不匹配,但它仍然适用于当前版本。
回答by Florian
I stumbled upon this thread when searching on how to integrate Redmine with Gitorious properly. Since we managed to achieve this and now have some long (or medium) term expierience with it, I thought I'd share it.
在搜索如何正确地将 Redmine 与 Gitorious 集成时,我偶然发现了这个线程。由于我们设法实现了这一目标并且现在有了一些长期(或中期)的经验,我想我会分享它。
We took a different approach than cronjobs, since it was a bit too inflexible for us. We also refer to other tutorials for the installation part of Redmine and Gitorious in our blog post:
我们采用了与 cronjobs 不同的方法,因为它对我们来说有点太不灵活了。Redmine和Gitorious的安装部分我们也在我们的博文中参考了其他教程:
http://codepool.at/blog/archives/12
http://codepool.at/blog/archives/12
We are using this system for about 5 months now and are pretty happy with it. The only "issue" is that everytime you create a new project in Redmine, you have to run some terminal command so you can connect the project to the repository. Since we are not creating projects en masse, it is just the right approach for us.
我们现在使用这个系统大约 5 个月,对它非常满意。唯一的“问题”是每次在 Redmine 中创建新项目时,都必须运行一些终端命令,以便将项目连接到存储库。由于我们不是集体创建项目,因此这对我们来说是正确的方法。
I hope this helps!
我希望这有帮助!
回答by Lee Ballard
Another thing you may want to consider is access control. If you want to be able to control commit access to different projects through redmine then this will be helpful.
您可能需要考虑的另一件事是访问控制。如果您希望能够通过 redmine 控制对不同项目的提交访问,那么这将很有帮助。
Not sure how you would link redmine accounts with Gitorious but that may be possible as well.
不确定如何将 redmine 帐户与 Gitorious 联系起来,但这也是可能的。
回答by kraymer
I'm satisfied with my git+redmine setup (and use gitolite for repos administration), here are some python hooks I use to leverage the use of both tools :
我对我的 git+redmine 设置很满意(并使用 gitolite 进行 repos 管理),这里有一些我用来利用这两种工具的 python 钩子:
Preambule : setting up a rest.botuser
序言:设置rest.bot用户
Hooks operations will be performed being authentified as a rest.botuser.
Go to Redmine administration console and create this rest.botuser.
On Roles and permissionspage, create a Rest botgroup with View issuesand Edit issuesas only permissions.
Don't forget to configure authorized statuses transitions for this role on the Workflowpage.
Add rest.botuser to your projects with role Rest botassigned.
Hooks 操作将被验证为rest.bot用户。
转到 Redmine 管理控制台并创建这个rest.bot用户。
在角色和权限页面上,创建一个具有查看问题和编辑问题作为唯一权限的休息机器人组 。
不要忘记在工作流页面上为此角色配置授权状态转换。
将rest.bot用户添加到您的项目中,并分配了Rest bot角色。
Client commit-msghook: expand issue number to issue title
客户端commit-msg钩子:将问题编号扩展为问题标题
https://gist.github.com/KraYmer/4443858to edit and copy in <git dir>/share/git-core/templates/hooks
on the client machine
https://gist.github.com/KraYmer/4443858<git dir>/share/git-core/templates/hooks
在客户端机器上编辑和复制
This hook allows you to reference a Redmine issue in your git commit message by simply typing its issue number and having it automatically expanded by appending the issue subject.
这个钩子允许你在你的 git commit 消息中引用一个 Redmine 问题,只需输入它的问题编号,并通过附加问题主题自动扩展它。
'working on ref #1234' => 'working on ref #1234:Eliminate dangling pointers'
Server post-receivehook: change status of issues by parsing git commit messages
服务器post-receivehook:通过解析 git commit 消息来更改问题的状态
https://gist.github.com/KraYmer/5292077to edit and copy in the .gitolite/common/hooks
directory on the server
https://gist.github.com/KraYmer/5292077编辑复制.gitolite/common/hooks
到服务器上的目录
Referencing issues in commit messagesis a feature shipped with the default Redmine but is limited to simply referencing (no status changed) or closing the issue.
This hook aims to extend the set of recognized keywords to change the status of the issues on commits :
在提交消息中引用问题是默认 Redmine 附带的一项功能,但仅限于简单地引用(无状态更改)或关闭问题。
此钩子旨在扩展可识别的关键字集以更改提交问题的状态:
$ git push
...
remote: [post-receive] Parsing 1 commits for branch 'develop'
remote: [post-receive] Setting issue #1608 status to 'totest'
...
The hook takes care of fetching the changes as soon as a commit is done so the changes are reflected in real time on the website.
一旦提交完成,钩子就会负责获取更改,以便更改实时反映在网站上。