git 如何读取git日志图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5382255/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to read git log graph
提问by michael
In the git community book, it says
在 git 社区书中,它说
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.
您可以做的另一件有趣的事情是使用“--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 表示。
How should I read this graph? How does 420eac9
differ from the rest?
我应该如何阅读这张图表?如何420eac9
从剩下的有什么不同?
回答by eckes
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 thatis what 420eac9
does different from the rest: it's the only commit to the right branch.
e1193f8
,5a09431
并30e367c
提交到左支(得到|
的分支,在右侧),而420eac9
致力于右支(产生|
在左分支)。而这正是420eac9
从其他地方根本不同:它是唯一承诺分支,在右侧。
For the sake of completeness:
为了完整起见:
d6016bc
was the branching point5e3ee11
is the merging commit2d3acf9
is the first commit after merging
d6016bc
是分支点5e3ee11
是合并提交2d3acf9
是合并后的第一次提交
回答by Ilkka
420eac9
is on a different branch than the 3 commits "below" it. The branches diverged after d6016bc
and they were merged in 5e3ee11
.
420eac9
与“下面”的 3 个提交位于不同的分支上。之后分支分叉,d6016bc
然后合并到5e3ee11
.