Skip to content

Instantly share code, notes, and snippets.

@lovejavaee
Created February 13, 2018 07:18
Show Gist options
  • Save lovejavaee/c46cc349a8a8ef529b52283ac7c4931e to your computer and use it in GitHub Desktop.
Save lovejavaee/c46cc349a8a8ef529b52283ac7c4931e to your computer and use it in GitHub Desktop.
git-hist.sh
##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@lovejavaee
Copy link
Author

git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"

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