全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Merge, merge base?

又称: merge base · fast-forward merge · three-way merge

Definition 9.7 University Computer Science — Year 1 · 第 9 章 — Version Control with Git

To merge a branch bb into the current branch aa is to make aa contain the commits of bb. The merge base of two commits is their best common ancestor: a common ancestor of which no other common ancestor is a descendant. If the tip of aa is itself the merge base, aa is simply moved to the tip of bb: a fast-forward merge. Otherwise Git makes a three-way merge: it compares each file in the merge base, in aa and in bb, keeps every change made on either side, and records the result in a merge commit with two parents.

The commit graph of , each arrow going from a commit to its parent. The fast-forward only moved the name main; the three-way merge made commit 58e3, whose two parents are the tips of the two branches, and whose content combines both changes made since the merge base 9fdd.
The commit graph of Output 9.4, each arrow going from a commit to its parent. The fast-forward only moved the name main; the three-way merge made commit 58e3, whose two parents are the tips of the two branches, and whose content combines both changes made since the merge base 9fdd.
在原文中阅读 →