3

When I run:

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

I see this output:

* 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

Which is a flat list of commits without showing all branches. However, in the past the output used to have red lines that would show a branch separated from the master; something similar to this (obviously this is the output from a different repo):

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

I know I have a branch because when I run $ git branch it shows:

include-user-destinations
* master

My guess is that I have made a change to my git config that has changed the output. Any ideas on how I can show the branch lines again?

Sherwine
  • 31
  • 1
  • 2
  • 1
    Look at your top 3 commits: your branch `include-user-destinations` is 2 commits ahead of `master` and can be fast-forwarded. There is a linear history because the branches are linearly connected. Try adding a commit to master and then running the log command again, you'll see branching. – Kraigolas May 21 '21 at 06:19

1 Answers1

4

Basically, git log doesn't bother with the lines until it needs them. See, e.g., this answer to Pretty Git branch graphs. Only a few commits have lines between them, when the asterisks don't line right up one atop another.

In some rare cases, this particular output can be ambiguous. Run git log --graph without --oneline to eliminate the ambiguity, or use one of those fancy graph-drawers that always includes lines, if you think you have such a case.

torek
  • 448,244
  • 59
  • 642
  • 775