将一个更改合并为多个分支 [英] Merging one change into multiple branches

查看:142
本文介绍了将一个更改合并为多个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我在分支主人(或其他分支)上执行了修补程序,那么怎么能我很容易将这个修复合并到所有这些分支中。我是否必须逐一合并每个分支(如下所示:合并一个更改为Git中的多个分支)或者是否有更简单的方法?

解决方案

我建议您拥有查看 git流程,它是工具支持



git流程的热补丁支持创建了一个bugfix分支,可以合并到您的生产分支(可能 master )和您的开发分支(在git flow develop 中)。修补程序分支从 master 开始。由于每次发布后master的所有更改都合并到 develop 中,所以您可以将修补程序分支合并到 develop 中,而无需合并您并未打算合并的提交。


I'm using git and I have a repo with a bunch of branches.

If I do a hotfix on branch master (or another branch), how can I easily merge this fix into all those branches. Do I have to merge each branch one by one (like so: Merging one change to multiple branches in Git) or is there an easier way?

解决方案

I'd recommend you have a look at git flow and it's tool support.

The hotfix support of git flow is creating a bugfix branch which can be merged into your production branch (probably master) and your development branch (in git flow develop). The hotfix branch starts from master. Since all changes of master are merged into develop after each release you can merge the hotfix branch into develop as well without having to merge commits you didn't intend to be merged.

这篇关于将一个更改合并为多个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆