gpt4 book ai didi

git - 如何阅读 git 日志图

转载 作者:IT王子 更新时间:2023-10-29 00:32:31 26 4
gpt4 key购买 nike

在 git community book 中,它说

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.

我应该如何阅读这张图? 420eac9 与其他部分有何不同?

最佳答案

星号表示提交的地方:

e1193f85a0943130e367c 被提交到左分支(在右分支上产生 | ) 而 420eac9 被提交到右分支(在左分支上产生一个 |)。 就是 420eac9 与其他分支的不同之处:它是对正确分支的唯一提交。

为了完整起见:

  • d6016bc 是分支点
  • 5e3ee11 是 merge 提交
  • 2d3acf9 是 merge 后的第一次提交

关于git - 如何阅读 git 日志图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5382255/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com