Skip to content

Instantly share code, notes, and snippets.

@wuminzhe
Forked from johanmeiring/gist:3002458
Created October 11, 2021 01:30
Show Gist options
  • Select an option

  • Save wuminzhe/828b6be186821c9b1be7204598789193 to your computer and use it in GitHub Desktop.

Select an option

Save wuminzhe/828b6be186821c9b1be7204598789193 to your computer and use it in GitHub Desktop.
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@wuminzhe
Copy link
Author

Tip: Remove the last -- to be able to set flags when using the alias.

For example, to view all branches (regardless of whether they are merged into the current one) you could then do git lg --all. This works for any flags that work with the original git log command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment