Skip to content

Instantly share code, notes, and snippets.

@jettero
Last active February 17, 2021 16:55
Show Gist options
  • Save jettero/31b37ebe31db02a99127a3f0e4b86821 to your computer and use it in GitHub Desktop.
Save jettero/31b37ebe31db02a99127a3f0e4b86821 to your computer and use it in GitHub Desktop.
# Personally I feel completely blind without my various logs. Especially
# `ftlog` for when I just can't figure out where I am in the tree.
#
# Every now and again, when people I'm helping with git that are feeling
# totally lost, I wish they had these commands. in reality, they totally do,
# `mylog` could probably just be `log --oneline`; but my format reveals details
# to help me figure out where I actually am. In particular, the commit id (%h)
# -- and/or reflog selector (%ar), the committer email (%ae), and the head and
# branch names (%d) where they occur in the tree. I suppose it helps an awful
# lot to know the human relatable timestamp too (%ar).
# this is more or less how I remember the command names and purpose
# tlog is my tree log
# tlogs is the tree logs, but simplified
# ftlog is the full tree log, and ftlogs is simplified
# slog, rather than being simplified is my stat log
# fslog is the full slog
[alias]
mylog = log --pretty='format:%C(yellow)%gd%C(bold)%h%C(bold blue) %ae%Creset%C(bold magenta)%d%Creset %s %C(bold black)%ar%Creset'
tlog = ! git mylog --graph
tlogs = ! git tlog --simplify-by-decoration
ftlog = ! git tlog --all
ftlogs = ! git tlogs --all
slog = ! git mylog --graph --stat
fslog = ! git slog --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment