将开发分支合并到主分支的最佳实践是什么 [英] what is the best practice to merge develop branch to master branch
问题描述
我们在远程git仓库中有两个分支:master分支和develop分支.当我将开发分支合并到主分支时,如何避免合并冲突?如果我解决了master分支中的冲突,那么我需要将master分支合并回develop分支,以保持develop的更新.我认为这不是一个好习惯.有人可以帮我吗?
We have two branches in the remote git repository: master branch and develop branch. When I merge develop branch into master branch, how can I avoid merging conflict? If I solve the conflict in the master branch, then I need to merge master branch back to develop branch to keep develop updated. I do not think it is a good practice. Can anyone help me with this?
我的问题更多是关于将开发分支合并到主分支以保持主分支干净的最佳实践.
My question is more on what the best practice to merge develop branch to master branch to keep master branch clean.
谢谢
推荐答案
我的问题更多是关于将开发分支合并到主分支以保持主分支干净的最佳实践
My question is more on what the best practice to merge develop branch to master branch to keep master branch clean
您可以遵循gitflow,在此处查看详细说明: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
You could follow gitflow, see detailed explanation here: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
总结:
- 保持主版本与最新版本不同步
- 合并要开发的功能分支
- 合并修补程序分支以进行开发和掌握
- 创建常规发行版(而非修补程序)时,请在发行时创建一个从development合并到master的发行分支
这篇关于将开发分支合并到主分支的最佳实践是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!