gpt4 book ai didi

git - 何时在 git 分支模型中增加版本

转载 作者:太空狗 更新时间:2023-10-29 14:19:09 25 4
gpt4 key购买 nike

目前正在使用 http://nvie.com/posts/a-successful-git-branching-model/效果很好。

我不太清楚的一点是如何处理在创建发布分支时完成的修复。

如果它是一个常规的修补程序,我会从 master 分支出来,完成修复,然后 merge 到 master 和 release 中。但是,如果它是一个要 merge 到我当前版本中的修复程序,我是从该版本中分支出来然后与一个 merge 对象 merge 回去,还是我只修复发布分支上的错误?我是否会为我在发布分支上完成的每个修复增加版本号?

最佳答案

One point that I'm not really clear on is how to handle fixes that are done while a release branch is created.

根据Git Flow模型,修补程序

arise from the necessity to act immediately upon an undesired state of a live production version.

如果在发布分支上工作时,您非常需要修补程序(例如,高安全风险)以至于您等不及发布分支完成,Git Flow 规定您执行以下操作:

The one exception to the rule here is that, when a release branch currently exists, the hotfix changes need to be merged into that release branch, instead of develop. Back-merging the bugfix into the release branch will eventually result in the bugfix being merged into develop too, when the release branch is finished. (If work in develop immediately requires this bugfix and cannot wait for the release branch to be finished, you may safely merge the bugfix into develop now already as well.)

(感谢 correcting me on this ;我完全忘记了那个异常。)


However, if it's a fix to be incorporated into my current release, do I branch off the release then merge back in with a merge object or do I just fix the error on the release branch?

据我了解,既然你写了

[if] it was a regular hotfix [...]

有问题的修复不是很紧急,不符合修补程序的条件。在那种情况下,为什么不直接在发布分支上做呢?毕竟根据Git Flow模型,这就是发布分支的用途:

Release branches support preparation of a new production release. They allow for last-minute dotting of i’s and crossing t’s. Furthermore, they allow for minor bug fixes and preparing meta-data for a release (version number, build dates, etc.).


Do I increment the version number for each fix I complete on a release branch?

没有。一旦创建了发布分支,版本号就一成不变。对后者进行修复不应导致版本号发生变化。

关于git - 何时在 git 分支模型中增加版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25775226/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com