Skip to content

Instantly share code, notes, and snippets.

@jaguarfi
Last active March 8, 2021 12:51
Show Gist options
  • Save jaguarfi/d194c1dd77170b1b44c6d7d55174cfe1 to your computer and use it in GitHub Desktop.
Save jaguarfi/d194c1dd77170b1b44c6d7d55174cfe1 to your computer and use it in GitHub Desktop.
Add aliases for the git log command

Open the terminal and type or copy the following commands.

git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.hist "log --pretty=format:'%C(yellow)%h%Creset %Cgreen%ad%Creset | %s %C(bold blue)[%an] %C(bold red)%d' --graph --date=short --color"

You can verify that the aliases have been added by running the command git config --list. You should see something like this in the terminal:

alias.lol=log --graph --decorate --pretty=oneline --abbrev-commit --all
alias.hist=log --pretty=format:'%C(yellow)%h%Creset %Cgreen%ad%Creset | %s %C(bold blue)[%an] %C(bold red)%d' --graph --date=short --color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment