# Git log with graph and decorations

> A mnemonic trick to remember the parameters of git log --all --decorate --oneline --graph: think of the phrase A Dog.

- Autore / Author: Diego Betto (https://diegobetto.com/about/)
- Pubblicato / Published: 2024-01-17
- URL: https://diegobetto.com/en/git-log-a-dog/
- Tag: git, log, dog, easy

How do you remember the list of parameters to add to the _git_ command to display the graph with all the information from the terminal?

Just remember **A Dog**.

That is: "**A Dog**" = git log --**a**ll --**d**ecorate --**o**neline --**g**raph

## What each parameter does

- `--all`: shows commits from every branch, not just the current one
- `--decorate`: adds branch and tag names next to the commits they point to
- `--oneline`: compresses each commit to a single line (short hash + message)
- `--graph`: draws the tree structure, with merges between branches clearly visible

Put together:

```bash
git log --all --decorate --oneline --graph
```

## Save it as an alias

So you don't have to type it out every time, save it as a Git alias:

```bash
git config --global alias.lg "log --all --decorate --oneline --graph"
```

From then on, just type `git lg` to get the same view.
