简体   繁体   English

开发分支的Gitflow标记?

[英]Gitflow tagging of develop branch?

It is necessary for our develop branch to be tagged because our build process takes the tag name as the semver build version, eg v3.5.1. 因为我们的构建过程将标记名称作为semver构建版本,例如v3.5.1,所以必须对我们的developer分支进行标记。 Develop branch can be built any time and deployed to staging server automatically. 可以随时构建Develop分支,并将其自动部署到登台服务器。

However, gitflow model only describes how and when to tag master branch. 但是,gitflow模型仅描述标记主分支的方式和时间。 If I start tagging develop branch as well, I will "lose" those names and won't be able to use them for tagging master branch. 如果我也开始标记developer分支,我将“丢失”这些名称,并且将无法使用它们来标记master分支。

I could for example tag the develop branch to something bigger than current master, every time I tag the master. 例如,每次我标记master时,我都可以将develop分支标记为比当前master大的对象。 But then I would have to remember to next time tag the master to something bigger than previous develop tag. 但是接下来,我将不得不记住,下次将master标记为比以前的development标记更大的标记。

Any other advice how to manage this workflow? 还有其他建议如何管理此工作流程?

There are basically two types of references in Git: Git中基本上有两种类型的引用:

  • tags, which are put by the user, and which aren't supposed to move 标签,由用户放置,不应移动
  • branches, which are updated by Git itself 分支,由Git本身更新

So, if you plan to put regularly tags with no real semantic, you're more or less re-inventing the concept of branch. 因此,如果您打算定期放置没有真实语义的标签,则或多或少地在重新发明分支的概念。 But you're managing it manually. 但是您是手动管理它。

To put it in a nutshell: my advice to manage this workflow would be to adapt a bit the build tool, to ensure that it doesn't only takes into account tags, but that it can also take into account the develop branch. 简而言之:我对管理此工作流的建议是对构建工具进行一些调整,以确保它不仅考虑标签,还考虑develop分支。

(It would probably not be too hard to do, because git can often be given a tag name or a branch name without change in semantic) (这可能并不难,因为可以在不改变语义的情况下为git赋予标签名或分支名)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM