在Git中管理多项目分支 [英] Managing Multi-Project Branches in Git

查看:328
本文介绍了在Git中管理多项目分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




  • 有一些工具可以在Maven项目/ SCM场景中实现以下抽象操作:给定一个应用程序项目,传递的应用程序及其使用的所有快照库;这些分支应该可以作为一个逻辑分支来管理(见下文)。
  • 给定应用程序项目的逻辑分支,释放它(通过运行Maven版本);这意味着释放多个分支,每个分支



背景(原始):

<如您所知,Git建议使用每个项目的存储库结构化范例。与此同时,任何认真的项目,在我们这个基于Maven的项目中,都附属于几个内部图书馆。在任何sprint中,项目和它所连接的库都会被修改。在Git世界中,这意味着修改将存在于几个Git仓库中。



如果我们想分割sprint中的工作,也许是因为我们使用了Gitflow,邀请我们在sprint的最后创建一个发行版分支,我们如何以逻辑的方式跨所有参与sprint的库,而不是手动分支每个库?



Maven感知工具(可以反省POM以找出传递快照依赖列表)会更好。



我可以创建一个逻辑我的多个物理分支(每个项目一个)之间的关系代表我的一个逻辑分支?



Git或某种Git工具是否支持逻辑分支? b
$ b

我希望你不会说子模块。我在这里寻找的是抽象出VCS的细节,而不是成为Git专家。另外,我希望尽可能在一个操作中执行某些操作,因为不得不单独分支每个库,这很容易出错,并且很容易被人遗忘。

建立一个服务器。



它可以将每个maven模块构建为一个单独的项目,然后自动重建任何具有快照依赖关系的其他项目。



更新



Jenkins的GIT插件具有管理开发功能分支自动合并为主或集成分支的功能。请参阅文档:



https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeatures



另一个选择是使用代码审阅工具(如 Gerrit )控制功能开发。
Gerrit控制整合到共享代码流上的变化,Gerrit可以与Jenkins集成,以确保所有提交的变更集都能通过代码测试。


最终发布会使用 M2发布插件进行切割,这是一个封装标准版本插件。 (也就是说,在Jenkins中总是会有两种构建类型:通过UI显式触发的代码提交和发布构建触发的自动构建)。

Are there tools to achieve the following abstract operations in a Maven project/SCM scenario?

  • Given an application project, create branches for the application and all the snapshot libraries that it uses, transitively; these branches should be manageable as one logical branch (see next)
  • Given the logical branch of an application project, release it (by running Maven release); this means releasing multiple branches, one per library

Background (original):

As you know, Git recommends using the repository-per-project structuring paradigm. At the same time, any serious project, in our case Maven-based, is attached to several in-house libraries. During any sprint, both the project and the libraries that it is attached to are modified. In a Git world, this means that modifications will exist across several Git repositories.

If we wanted to branch out the work in the sprint, perhaps because we use Gitflow, which invites that we create a release branch at the end of our sprint, how would we do it in a logical manner across all the libraries involved in the sprint, instead of manually branching each library?

A Maven-aware tool (one that can introspect the POMs to figure out the transitive snapshot dependency list) will be even better.

Can I create a logical relationship between my multiple physical branches (one per project) that represent my one logical branch?

Does Git, or some Git tool, support logical branches?

I'm hoping you're not going to say submodules. What I'm looking for here is to abstract out the details of the VCS, not to become a Git guru. Also, I'm looking to do things in one operation where possible, as having to individually branch each library is error prone and easily forgotten.

解决方案

Setup a Jenkins server.

It can build each maven module as a separate project and then automatically rebuild any other projects that has a snapshot dependency relationship.

Update

The GIT plugin for Jenkins has a feature for managing the automatic merging of development feature branches into a "master" or "integration" branch. See the documentation:

https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeatures

Another option is to control feature development using a code review tool like Gerrit. Again it's Gerrit that controls changes integrated onto the shared code stream and Gerrit can be integrated with Jenkins to ensuring all submitted change-sets pass the code tests.

Finally releases are cut using the M2 Release plugin, which is a wrapper around the standard release plugin. (Means you'll always have two types of build in Jenkins. Automated builds triggered by code commits and release builds explicitly triggered via the UI).

这篇关于在Git中管理多项目分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆