If you use "git log", remember a dog

By ubaumann, Tue 10 August 2021, modified Tue 10 August 2021, in category Brief Byte

git

To get a nicely formatted git history git log can be used in the terminal. Just think about a dog, to remember the option for generating a readable graph.

You can generate an alias for easier use:

git config --global alias.dog "log --all --decorate --oneline --graph"
git dog

From the git log --help:

--all

Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as .

--no-decorate, --decorate[=short|full|auto|no]

Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/ will not be printed. If full is specified, the full ref name (including prefix) will be printed. 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 default option is short.

--oneline

This is a shorthand for "--pretty=oneline --abbrev-commit" used together.

--graph

Draw a text-based graphical representation of the commit history on the left hand side of the output. This may cause extra lines to be printed in between commits, in order for the graph history to be drawn properly. Cannot be combined with --no-walk. This enables parent rewriting, see History Simplification above. This implies the --topo-order option by default, but the --date-order option may also be specified.

crontab.guru example