Why does git log doesn't show HEAD and branches when passed to a pager
Asked Answered
N

1

0

When passed to a pager (git log | less, watch git log, etc), the (HEAD -> master, origin/master, origin/HEAD) doesn't show up.

Niklaus answered 11/5, 2022 at 7:4 Comment(1)
Note that git log will run the pager for you automatically by default, under various conditions. See pager.log, core.pager, and other Git settings. (This is described in the git config documentation, which is very long and generally requires a lot of searching.)Catarina
N
3

It's called ref names. It doesn't show up because if we don't specify --decorate, git log will use --decorate=auto by default.

From the docs:

If auto is specified, then if the output is going to a terminal, the ref names are shown as if short were given, otherwise no ref names are shown. The option --decorate is short-hand for --decorate=short. Default to configuration value of log.decorate if configured, otherwise, auto.

Niklaus answered 11/5, 2022 at 7:4 Comment(1)
If you also want color, you can use --color=always or --color, e.g. git log --decorate --color | less -R or watch -c 'git log --decorate --color'Samsun

© 2022 - 2024 — McMap. All rights reserved.