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

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

问题描述

假设两个分支已经分离,并且一个分支(而不是所有分支)的具体提交需要引入另一个分支,那么git cherry pick就可以达到这个目的。

经过一段时间后,需要将两个分支完全合并。 git会如何知道它已经提供了过去被樱桃采摘的承诺,以便它不会重新引入它?

解决方案

您可能想要阅读

尝试樱桃选择vs合并工作流程,以便在合并和樱桃选择之间进行很好的比较,尤其是樱桃-pick不会存储父母身份,因此不会知道它已经提交了樱桃在过去的提交,以便它不会重新引入它。





http://davitenio.wordpress.com/2008/09/27/git-merge-after-git-cherry-pick-avoiding-使用 rebase


来重复提交/
关于如何避免重复提交的提交

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.

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?

解决方案

You might want to read

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.

and

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天全站免登陆