本文介绍了Git修复现有标签/发行版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我将一个新版本投放到生产环境中,例如1.0使用git标记,并继续在master上工作.如果我需要修复1.0标签会怎样?我克隆/获取1.0,然后向其中添加提交以修复错误,但不是仅标记一个标记工具吗?当我推送delta 1.0+时,它们会进入哪个分支?

在SVN中相同的用例,我将有两个单独的分支1.0和主干,很明显1.0可以自己分开(然后合并到主干),但是在git中,我不清楚它是如何工作的

解决方案

因此,简短的答案(需要花费一些时间阅读)是采用Vincent的 Git Flow 模型.第一次凝视git时,它作为起点非常有效.如果没有其他内容,那么最好先阅读一下以了解有关git的更多信息.

话虽如此.这是我会做的

  • 签出代码并将其转换为分支(如果尚不存在)
  • 进行更改并进行测试,然后使用1.1(或类似版本)重新标记
  • 发布
  • 将母版(如果您喜欢的话,请选择樱桃")合并到母版中以保持将来的版本(2.0)也已修复了该错误.

Suppose I roll a new version to production e.g. 1.0 using git tagging and continue working on master. What happens if I need to hotfix the 1.0 tag? I clone/fetch 1.0 and then add commits to it for the purpose of bug fixing, but isn't tagging simply a marking facility only? when I push my delta 1.0+ commits which branch do they go to?

The same use-case in SVN I would have two separate branches 1.0 and trunk and it is clear that 1.0 can diverge on its own (and then merge to trunk) but in git it is not so clear to me how this works.

解决方案

So, the short answer (that takes some time to read) is to adopt Vincent's Git Flow model. It works really great as a starting point when first staring out with git. If nothing else it's a good read to understand more about git.

That being said. Here is how I would do it

  • checkout the tag and convert it to a branch (if such doesn't already exists)
  • make the changes and test them, retag with 1.1 (or similar)
  • release
  • merge (or cherry-pick if thats your flavour) into master to keep future releases (2.0) also have the bug fixes.

这篇关于Git修复现有标签/发行版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 21:56
查看更多