Skip to content

Instantly share code, notes, and snippets.

@nawedx
Created April 20, 2025 14:44
Show Gist options
  • Save nawedx/c7cec429a19bcced9d22046e8d0df706 to your computer and use it in GitHub Desktop.
Save nawedx/c7cec429a19bcced9d22046e8d0df706 to your computer and use it in GitHub Desktop.
Cool Git Log Aliases and Commands

Cool Git Log Aliases and Commands

Aliases for colorized form of git log --oneline with commit's time in relative format and actual format.

alias glr='git log --oneline --format="%C(auto)%h %C(green)%ad%Creset %s" --date=relative'
alias gla='git log --graph --pretty=format:"%C(yellow)%h%Creset - %C(bold blue)%an%Creset, %C(green)%ad%Creset : %s" --date=format:"%Y-%m-%d %H:%M:%S"'

Sample output for glr

a1b2c3d 2 hours ago Fix login page styling

Sample output for gla

* a1b2c3d - John Doe, 2024-03-15 14:30:45 : Fix login page styling

git log --oneline by author filter

Exact author name:

git log --oneline --author="Jane Smith"

Partial match (email or username):

git log --oneline --author="[email protected]"

or

git log --oneline --author="github_username"

Case-insensitive search (regex):

git log --oneline --author="john" --regexp-ignore-case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment