如何阅读git日志图 [英] How to read git log graph
问题描述
在git社区书中,它说
另一个有趣的事情是使用'--graph '选项,如下所示:
$ git log --pretty = format:'%h:%s'--graph
* 2d3acf9:忽略SIGCHLD在陷阱
* 5e3ee11上的错误:合并git://github.com/dustin/grit分支'master'
| \
| * 420eac9:添加了获取当前分支的方法。
* | 30e367c:超时代码和测试
* | 5a09431:将超时保护添加到砂砾
* | e1193f8:支持带有斜杠的元首
| /
* d6016bc:需要时间支付xmlschema
它会给出提交历史记录行的相当不错的ASCII表示形式。
我应该如何阅读此图表? 420eac9
与其余的不同之处在哪里?
e1193f8
, 5a09431
和 30e367c
被提交给左分支(在右分支上产生一个 |
),而 420eac9
被提交给右分支(在左分支上产生一个 |
)。 是 420eac9
与其余部分不同:它是唯一向右分支提交的。
出于完整性考虑:
d6016bc
点
5e3ee11
是合并提交
2d3acf9
In the git community book, it says
Another interesting thing you can do is visualize the commit graph with the '--graph' option, like so:
$ 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
It will give a pretty nice ASCII representation of the commit history lines.
How should I read this graph? How does 420eac9
differ from the rest?
The asterisks show where something was committed:
e1193f8
, 5a09431
and 30e367c
were committed to the left branch (yielding a |
on the right branch) whereas 420eac9
was committed to the right branch (yielding a |
on the left branch). And that is what 420eac9
does different from the rest: it's the only commit to the right branch.
For the sake of completeness:
d6016bc
was the branching point5e3ee11
is the merging commit2d3acf9
is the first commit after merging
这篇关于如何阅读git日志图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!