什么是在各种期货分支上工作并使其自动同步的良好设置? [英] What is a good setup for working on various futures branches and have them synced automatically?

查看:57
本文介绍了什么是在各种期货分支上工作并使其自动同步的良好设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

项目越来越大,我们有几个集成分支机构:

Project is getting bigger and we have several integration branches:

  • master ->已发布的代码
  • develop ->代码即将发布
  • develop-8_6 ->代码将在8.6版本中发布
  • develop-8_7 ->代码将在8.7版本中发布
  • develop-8_8 ->代码将在8.8版本中发布
  • develop-8_9 ->将在8.9版本中发布的代码
  • develop-8_10 ->代码将在8.10版本中发布
  • 依此类推...
  • master -> released code
  • develop -> code to be released very very soon
  • develop-8_6 -> code to be released in at some point as 8.6 version
  • develop-8_7 -> code to be released in at some point as 8.7 version
  • develop-8_8 -> code to be released in at some point as 8.8 version
  • develop-8_9 -> code to be released in at some point as 8.9 version
  • develop-8_10 -> code to be released in at some point as 8.10 version
  • and so on...

作为集成分支,每个分支必须包含对先前分支的所有更改.另外,每个分支都接收来自开发人员的拉取请求(例如 dev/8_7featureX ).必须回顾每个功能分支,并且合并它通常只是gitlab/github中的一个按钮.没问题我的痛点是将一个集成分支合并到另一个 develop -> develop-8_6 -> develop-8_7 -> ...

As integration branches, each branch must contain all changes from previous branches. Also, each branch receives pull request from developers (ex dev/8_7featureX). Each feature branch must be reviewed and merging it is usually just a button in gitlab/github. No problem here. My pain-point is when merging one integration branch into the other develop -> develop-8_6 -> develop-8_7 -> ...

到目前为止,我一直在手动合并所有分支,有时很容易,有时由于冲突而花费时间等.但这无休止,我认为拥有多个集成分支是诸如 Gitlab 等.

So far I have been merging all branches manually, sometimes it is easy, sometimes it takes time due to conflicts, etc. But this is endless, I think having several integration branches is common approach for big projects like Gitlab, etc.

问题:

如何为将来的所有发行分支自动完成集成分支合并过程?我读到有关在服务器上实现git receive挂钩的信息,但不清楚如何处理冲突.有人可以指出我正确的方向吗?还是显示一些具体示例或方法来合并所有开发分支?

How can integration branches merge process be automatically done for all future release branches? I read about implementing git receive hooks on the server but it was unclear how to deal with conflicts. Could someone point me in the right direction? Or show some specific examples or approaches to merge all develop branches?

换句话说,Gitlab项目中的人员如何处理如此众多的集成分支?他们如何使其自动化?(或者这是手动完成的?)

In other words, how people in Gitlab project deal with so many integration branches? How did they automatize it? (Or this is manually done?)

推荐答案

首先,请确保如果您解决了相同的冲突,请尝试激活 re 使用 re 编码重新解决方案").

First, make sure that, if you find yourself fixing the same conflict, you try and activate git rerere ("reuse recorded resolution").

git config --global rerere.enabled true

这将为您记录那些冲突的解决方法.

That will record for you those conflict resolution.

更多信息,请参见"修复与克里斯托弗·波特内努夫

如果您更喜欢rerere来自动暂存已解决的文件(我愿意),则可以要求它:您只需要像这样调整配置即可:

if you prefer rerere to auto-stage files it solved (I do), you can ask it to: you just need to tweak your configuration like so:

git config --global rerere.autoupdate true

第二,最好使用要素分支(尽可能彼此独立),然后合并到一个集成分支(一个 dev 分支)中
您可以在 gitworkflow(一个字)

Second, it is best to work with feature branches (as independent one from another as possible), and merge then in one integration branches (a dev branch)
You can see an example in gitworkflow (one word)

这篇关于什么是在各种期货分支上工作并使其自动同步的良好设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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