109

在 git community book 中,它说

您可以做的另一件有趣的事情是使用“--graph”选项可视化提交图,如下所示:

$ git log --pretty=format:'%h : %s' --graph
* 2d3acf9 : ignore errors from SIGCHLD on trap
*   5e3ee11 : Merge branch 'master' of git://github.com/dustin/grit
|\
| * 420eac9 : Added a method for getting the current branch.
* | 30e367c : timeout code and tests
* | 5a09431 : add timeout protection to grit
* | e1193f8 : support for heads with slashes in them
|/
* d6016bc : require time for xmlschema

它将为提交历史行提供一个非常好的 ASCII 表示。

我应该如何阅读这个图表?420eac9与其他人有何不同?

4

2 回答 2

139

星号显示某事发生在哪里:

e1193f8,5a09431并被30e367c提交到左分支(|在右分支上产生 a),而420eac9被提交到右分支(|在左分支上产生 a)。这就是与其他的420eac9不同之处:它是对正确分支的唯一提交。

为了完整起见:

  • d6016bc是分支点
  • 5e3ee11是合并提交
  • 2d3acf9是合并后的第一次提交
于 2011-03-21T19:43:14.787 回答
21

420eac9与“下面”的 3 个提交位于不同的分支上。之后分支分叉d6016bc,并入5e3ee11

于 2011-03-21T18:58:46.383 回答