Skip to content

Instantly share code, notes, and snippets.

@kwmiebach
Last active August 29, 2015 14:19
Show Gist options
  • Save kwmiebach/7427d30952b5e61df7b0 to your computer and use it in GitHub Desktop.
Save kwmiebach/7427d30952b5e61df7b0 to your computer and use it in GitHub Desktop.
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"
# With absolute date ISO style:
# git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci)%C(bold blue)<%an>%Creset' --abbrev-commit"
# usage:
# $ git lg
# redirect to file:
# $ git lg | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" > git-lg.txt
# sed from http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed
# by https://github.com/fredkschott
# http://fredkschott.com/post/2014/02/git-log-is-so-2005/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment