Git log --all --oneline --decorate --graph 不显示只有星号的分支

时间:2021-05-21 04:51:32

标签: git logging branch

当我跑步时:

$ git log --all --decorate --oneline --graph

我看到这个输出:

* 159d15f (origin/include-user-destinations, include-user-destinations) Add destination to Scotland
* 16b251a Add destinations to Florida and Paris
* 650a8de (HEAD -> master, upstream/master, origin/master, origin/HEAD) Update index.html
* 574c456 changed travel destinations
* 9039cf9 changed to Sao Paolo
* b2d0353 Add animation to destination headings
* 1204be0 Style destinations
* 7562e21 Add starting destinations
* 5e9b201 Initial commit

这是一个扁平的提交列表,没有显示所有分支。但是,在过去,输出曾经有红线,表示与 master 分开的分支;与此类似的东西(显然这是来自不同存储库的输出):

* e6122521 (HEAD -> master) 
*   f533d9eb 
|\
|/|
* |   7c2cb982 Merge branch 
|\ \

我知道我有一个分支,因为当我运行 $ git branch 时它显示:

include-user-destinations
* master

我的猜测是我对 git 配置进行了更改,从而改变了输出。关于如何再次显示分支线的任何想法?

1 个答案:

答案 0 :(得分:1)

基本上,git log 在需要它们之前不会打扰。参见,例如,this answerPretty Git branch graphs。只有少数提交在它们之间有线,当星号没有一个接一个地排成一行时。

在一些极少数情况下,这个特定的输出可能是模棱两可的。运行不带 git log --graph--oneline 以消除歧义,或者使用那些总是包含线条的精美图形抽屉之一,如果您认为自己有这种情况。