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

M Imam Pratama
- 998
- 11
- 26
-
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](https://git-scm.com/docs/git-config), which is very long and generally requires a lot of searching.) – torek May 11 '22 at 11:36
1 Answers
2
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.

M Imam Pratama
- 998
- 11
- 26
-
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'` – Jay May 11 '22 at 08:48