La commande que tout le monde copie
git log --all --graph --decorate --oneline
Anatomie
--all - inclure toutes les branches et tags.
--graph - dessiner le graphe parent/enfant en ASCII.
--decorate - annoter les commits avec les noms de branche et tag.
--oneline - raccourci pour --pretty=oneline --abbrev-commit.
Meilleur formatage
git log --all --graph \
--pretty=format:'%C(yellow)%h%Creset %C(cyan)%an%Creset %s %C(green)(%cr)%Creset%C(red)%d%Creset' \
--abbrev-commit
En faire un alias
git config --global alias.lg "log --all --graph --pretty=format:'%C(yellow)%h%Creset %C(cyan)%an%Creset %s %C(green)(%cr)%Creset%C(red)%d%Creset' --abbrev-commit"
Filtrage
git lg -20
git lg --since='2 weeks ago'
git lg --author='Jane'
git lg --grep='OAuth'
git lg -- src/checkout.js
First-parent seulement
git log --first-parent --oneline main
Graphe complet pour une feature
git log --graph --boundary main...feature/oauth
Visualiseurs en direct
tig --all
gitk --all
Performance
git log --all --graph --oneline -n 100