git工作流与3个分支的建议 [英] git workflow with 3 branches advice
问题描述
我正在开发一个项目,在那里我们试图以最有效的方式来使用git(对于我们来说),并决定为2个子小组创建2个分支, master分支。
有时我们会承认主人是否应该进入两个分支,然后我们希望在其他分支中进行这些更改。 p>
-
这应该是合并还是分入其他两个分支?
-
这是一个疯狂的工作流程吗?如果是这样,建议请!
我没有看到重点为两队创造两个分支。工作应该根据其性质来分开,而不是由谁来完成。
这是我的建议:
当您有功能,错误修复或应该被处理:创建一个分支 feat-something ,并在那里工作。
这是(基本上)我们如何处理一个非常大的项目。如果你的项目不大,你可以在没有 dev 分支的情况下工作。
查看这篇着名的文章,展示了一个相当出色的工作流程:一个成功的Git分支模型。
I'm working on a project where we're trying to get to grips with using git in the most efficient manner (for us) and have decided to create 2 branches for 2 sub-teams to work on, along side the master branch.
Sometimes we will commit into master if it's something generic that should go into both branches and then we want those changes in the both of the other branches.
Should that be a merge or a rebase into the 2 other branches?
Is this an insane workflow to be going down the route of? If so, suggestions please!
I don't see the point of creating two branches for two teams. Work should be separated depending on its nature, not on who will work on it.
This is what I'd suggest:
- Use feature branches: Most of your work should be on these topic branches, except tiny commits (such as typos, etc.).
When you have a feature, bug fix, or a ticket that should be processed: create a branch feat-something, and work in there. - Use a dev, or release-X (where X is the release's number) branch: When a feature's branch work is done, tested, and works, rebase it into dev.
- Never commit on master, this branch should only be rebased into by the lead developer, CTO, whatever. Rebase dev's work into master when you feel it's needed.
This is (basically) how we work on a very big project. You can work without the dev branch if your project isn't big.
Check out this famous article that shows a pretty well done workflow: A successful Git branching model.
这篇关于git工作流与3个分支的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!