且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将一个更改合并为多个分支

更新时间:2023-11-23 11:22:22

我建议您拥有查看 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.