Git合并到所有分支 [英] Git merge to all branches

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

问题描述

我有分支

v1.0
v1.1
v1.2
v1.3
v1.4 [master]

现在我签出v1.0并添加一些带有文件的目录(数据库表,存储过程等)

now i checkout the v1.0 and add some directory with files (db tables, stored procedures, etc)

如何将新添加的目录与所有分支中的文件合并,以便使用该目录更新我的head分支

how to merge the newly added directory with files in all branches so my head branch will be updated with that directory

推荐答案

我想您只需要该特定目录,而无需在其他分支中引入其他更改,如果是这样的话,我想到的一种方法现在是git cherry-pick.

I guess you need just that particular directory and no other changes which were introduced in different branches, if that is the case then, one way which comes to my mind right now is git cherry-pick.

只需检查git log并找出负责添加该新目录以及您需要的所有其他内容的提交ID.现在,一个接一个地检查您的其他分支并使用

Just check git log and find out the commit id responsible for adding that new directory and everything else you need. Now checkout your other branches one by one and use

git cherry-pick <commid id>

该特定的提交将应用于相应的分支.

And that particular commit will be applied to that respective branch.

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

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