Created
November 8, 2017 19:04
-
-
Save ckarnell/f54aeb34693620fb032d2fb780404d97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add these to your .bashrc for fancy git logging: | |
# This optionally accepts a number as an argument (e.g. `gl 10`) to show that many commits. | |
# `gl` by itself will show all commits like a normal `git log`. | |
function gl { | |
if [ -z "$1" ] | |
then | |
git log --pretty=format:'%C(bold blue)%h %C(bold green)(%ar) %C(magenta)%an %Creset%s%C(bold yellow)%d' | |
else | |
git log --pretty=format:'%C(bold blue)%h %C(bold green)(%ar) %C(magenta)%an %Creset%s%C(bold yellow)%d' -$1 | |
fi | |
} | |
# Here's the same thing except you get to see a useless tree graph of the commits: | |
function glg { | |
if [ -z "$1" ] | |
then | |
git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
else | |
git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all -$1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment