遵循git-flow应该如何处理早期版本的修补程序? [英] Following git-flow how should you handle a hotfix of an earlier release?

查看:129
本文介绍了遵循git-flow应该如何处理早期版本的修补程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您尝试遵循git-flow分支模型,请此处记录并与这里的工具,你应该如何处理这种情况:

If you try to follow the git-flow branching model, documented here and with tools here, how should you handle this situation:

1.0版本和2.0版本。然后你需要为1.0做一个修补程序。您可以从1.0标签创建一个修补程序分支并在那里实施修复。但是呢?

You have made a 1.0 release and a 2.0 release. Then you need to make a hotfix for 1.0. You create a hotfix branch off the 1.0 tag and implement the fix there. But what then?

通常情况下,您将合并为主,并在其中放置1.1版本标签。但是你不能将1.1合并到2.0以后的master上。

Normally you would merge to master and put a 1.1 release tag there. But you can't merge 1.1 to a point after 2.0 on master.

我猜你可以把release标签放在修补程序分支上,但是这会创建一个永久分支除了包含发行标签的主人之外。这是正确的方式吗?

I guess you could put the release tag on the hotfix branch, but that would create a permanent branch beside the master that would contain a release tag. Is that the right way?

推荐答案

似乎git流中有一个支持分支的概念。这用于在早期版本中添加修补程序。

It seems that there is a concept of a "support" branch in git flow. This is used to add a hotfix to an earlier release.

这个线程有更多的信息,这些例子:

This thread has more information, with these examples:

git checkout 6.0
git checkout -b support/6.x
git checkout -b hotfix/6.0.1

...使你的修复,然后:

... make your fix, then:

git checkout support/6.x
git merge hotfix/6.0.1
git branch -d hotfix/6.0.1
git tag 6.0.1

或使用 git flow 命令

or using git flow commands

git flow support start 6.x 6.0
git flow hotfix start 6.0.1 support/6.x

.. 。make changes then:

... make changes then:

git flow hotfix finish 6.0.1

这篇关于遵循git-flow应该如何处理早期版本的修补程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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