Git 樱桃选择和数据模型完整性 [英] Git cherry pick and datamodel integrity

查看:23
本文介绍了Git 樱桃选择和数据模型完整性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于两个分支已经出现分歧,并且需要将来自一个分支(而不是所有分支)的特定提交引入另一个分支,git cherry pick 正好实现了这一点.

Given that two branches have diverged and a specific commit from one branch (and not everything) needs to be introduced to the other, git cherry pick achieves exactly that.

一段时间后需要将两个分支完全合并.git 怎么知道它已经有过去被挑选出来的提交,这样它就不会重新引入它?

After some time there is the need to completely merge the two branches. How will git know that it has already the commit that was cherry picked in the past so that it won't reintroduce it?

推荐答案

您可能想阅读

Git Cherry-pick vs Merge Workflow 用于合并之间的良好比较和cherry-pick,尤其是cherry-pick 不存储父ID,因此 知道它已经有过去被cherry 选择的提交,因此它不会重新引入它.

Git Cherry-pick vs Merge Workflow for a good comparison between merge and cherry-pick, especially that cherry-pick does not store parent id, and thus will not know that it has already the commit that was cherry picked in the past so that it won't reintroduce it.

http://davitenio.wordpress.com/2008/09/27/git-merge-after-git-cherry-pick-avoiding-duplicate-commits/ 关于如何避免在这种情况下重复提交,使用 <代码>变基.

http://davitenio.wordpress.com/2008/09/27/git-merge-after-git-cherry-pick-avoiding-duplicate-commits/ about how to avoid duplicating commits in this case, using rebase.

这篇关于Git 樱桃选择和数据模型完整性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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