简体   繁体   English

git-flow如何拥有演示分支?

[英]git-flow how to have demo branches?

We are a small team and work on a project using git and git-flow. 我们是一个小团队,正在使用git和git-flow进行项目。 Most of the time we develop towards one goal, so creating a feature and merging it when done to the develop branch works fine. 在大多数情况下,我们都朝着一个目标发展,因此创建功能并将其合并到开发分支后可以很好地工作。

But now we are in the situation were we have multiple features, but we would want to only deploy a few features at a time and demo some other features. 但是现在我们处在有多个功能的局面中,但是我们只想一次只部署几个功能并演示一些其他功能。 I can't see a good way of doing this, so the only idea we have is to manually create a demo branch, merge the features we want to merge there and deploy it (for demo only). 我看不到这样做的好方法,所以我们唯一的想法是手动创建一个演示分支,合并我们要合并的功能并部署它(仅用于演示)。 And once we decide that those features will be deployed, then we "git flow feature finish xxx" and do a deployment (as git-flow indicates). 并且一旦我们决定将要部署这些功能,那么我们就“完成git flow功能完成xxx”并进行部署(如git-flow所示)。

We can do all that, but I was looking for best practices on how to approach this issue. 我们可以做到所有这些,但是我一直在寻找有关解决此问题的最佳实践。 I found this stackoverflow question which is similar to what I have but the answer is not satisfactory. 我发现这个stackoverflow问题与我的问题类似,但答案并不令人满意。 So here I am. 所以我在这里。

Thanks in advance. 提前致谢。

Just create a demo branch out of develop and merge the features you want to demo: 只需从开发中创建一个演示分支,然后合并您要演示的功能:

$ git checkout develop $ git checkout开发

$ git branch demo $ git分支演示

$ git checkout demo $ git checkout演示

$ git merge feature1 $ git merge feature1

$ git merge feature2 $ git merge feature2

This is completely legit. 这是完全合法的。 It is cool if you have a mechanism (like git hook) to automatically deploy such a branch to some demo environment. 如果您有一种机制(如git hook)可以将这样的分支自动部署到某些演示环境,那就太好了。

The formal Git Flow document has reference to a release branch. 正式的Git Flow文档引用了发行分支。 Here I'd imagine that you would want to integrate all of the features that you have ready to go before release. 在这里,我想您可能希望集成发布前准备使用的所有功能。

That branch seems to be the most ideal to showcase/demo what's upcoming in your releases. 该分支似乎是展示/演示发布中即将发生的事情的最理想方法。 It should also be the branch that QA is testing fervently before it's merged up into master. 它也应该是QA在合并为master之前进行严格测试的分支。

Git can't manage the part about you not knowing which features are slated for a release, but if your project managers and your team work closely with each other, merging features like that to the release branch should work out well. Git无法管理关于您的部分,因为您不知道要为发布指定哪些功能,但是如果您的项目经理和您的团队彼此密切合作,那么将类似功能合并到发布分支中就可以很好地完成工作。

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

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