Skip to content

Instantly share code, notes, and snippets.

@jaeyow
Created May 23, 2023 11:50
Show Gist options
  • Save jaeyow/177cd176ce02645d89e8212b191aee8d to your computer and use it in GitHub Desktop.
Save jaeyow/177cd176ce02645d89e8212b191aee8d to your computer and use it in GitHub Desktop.
My Favourite git aliases
[alias]
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
a = add
ap = add -p
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
m = commit --amend --verbose
d = diff
ds = diff --stat
dc = diff --cached
s = status -s
co = checkout
cob = checkout -b
fp = fetch -p
p = pull
# list branches sorted by last modified
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# list aliases
la = "!git config -l | grep alias | cut -c 7-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment