Skip to content

Instantly share code, notes, and snippets.

@kainino0x
Last active October 31, 2025 21:01
Show Gist options
  • Select an option

  • Save kainino0x/3eab41aa952ec46888ee7099d4483d84 to your computer and use it in GitHub Desktop.

Select an option

Save kainino0x/3eab41aa952ec46888ee7099d4483d84 to your computer and use it in GitHub Desktop.
my personal `git lg` and friends
# Aliases
git config --global alias.lg "log --pretty=tformat:'%Cred%h%Creset %Cgreen%cd%Creset%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short-local"
git config --global alias.gr "log --graph --pretty=tformat:'%Cred%h%Creset %Cgreen%cd%Creset%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short-local"
git config --global alias.l '!git --no-pager lg main~.. && echo && git status --show-stash'
git config --global alias.br "branch --sort=-committerdate --format='%(HEAD) %(if)%(HEAD)%(then)%(color:green)%(end)%(committerdate:short) %(align:32)%(refname:short)%(end) %(contents:subject)'"
# Configs
# Automatically turn `--fixup` commits into fixups when running `git rebase -i`
git config --global --bool rebase.autoSquash true
# Prefer to always use --no-squash mode in `git cl upload` (for Chromium, etc.)
git config --global --bool gerrit.override-squash-uploads false # probably won't be overwritten but haven't verified
# Notes
# To debug OWNERS files, check the full list of owners for a file with:
# > git cl owners --show-all path/to/file
# HOWEVER note this doesn't seem to pay attention to local OWNERS file changes so it can't be used for pre-facto testing.
# buganizer userstyles
# b.corp: html { filter: hue-rotate(45deg); }
# issuetracker: html { filter: blur(1px); }
# old unused
#git config --global alias.rl "reflog --format='%C(auto)%h %<|(17)%gd %C(blue)%cr%C(reset) %s'" # drops branch info
#git config --global alias.st '!git --no-pager log -1 --oneline && git status -sb' # short status is hard to use
#git config --global alias.l '!git status -s; git --no-pager lg -n8;echo' # redundant
#git config --bool gerrit.squash-uploads false # gclient sync will overwrite this with `GERRIT_SQUASH_UPLOADS`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment