使用Git将主变更合并到所有分支中? [英] Merging changes from master into all branches using Git?

查看:201
本文介绍了使用Git将主变更合并到所有分支中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用git来维护我的代码的多个工作副本。我的想法是,我可以检出任何分支,构建并运行它以查看分支的特征x如何与代码的当前状态匹配。

Git的主分支是Trunk,其他git分支是我想要尝试的功能或事物。因此,我的典型用法是使用最新的修补程序更新主服务器,然后将主服务器合并到各个分支中,以便每个分支都保持最新状态。



这个系统对我来说很合适,除了我必须检查一个分支,合并master和冲洗/重复其他分支。考虑到像git这样的版本控制系统,考虑到随着时间的推移,我会倾向于产生大量分支,所以我没有看到这种扩展。

我仍然是git初学者,所以我怀疑可能有一种git已经存在的机制,我可能会错过。有一个吗?如果不是这样,一个人如何向所有分支提交更改,以便他们自己保持最新状态?

解决方案

没有测试过我自己):



您仍然需要以获取您的功能回购,并检查是否由于一些合并冲突而导致rebase或合并未被阻止。


I use git to maintain multiple working copies of my code. The idea is that I can check out any branch, build and run it to see how the branch's feature x fits in with the current state of the code.

Git's master branch is the Trunk and the other git branches are features or things I would like to try out. Therefore, my typical usage is updating the master with the latest fixes and then merging master into the individual branches so each of them stays up to date.

This system works well for me, except for the fact that I have to checkout a branch, merge the master and rinse/repeat for the other branches. Given a version control system like git, I don't see this scaling very well given the fact that I'd be prone to spawning a lot of branches over time.

I'm still a git beginner, so I suspect there may be a mechanism of sorts that git already has that I might be missing. Is there one? If not, how does one commit a change to all branches so they stay up to date on their own?

解决方案

One possibility (not tested myself) would be:

You will still need to get to your feature repo and check if the rebase or merge is not blocked due to some merge conflicts.

这篇关于使用Git将主变更合并到所有分支中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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