Skip to content

Instantly share code, notes, and snippets.

@MisterJames
Created July 28, 2016 22:04
Show Gist options
  • Select an option

  • Save MisterJames/dc53921d481adb96e0145f8896296dd2 to your computer and use it in GitHub Desktop.

Select an option

Save MisterJames/dc53921d481adb96e0145f8896296dd2 to your computer and use it in GitHub Desktop.
# based off the longer gist at https://gist.github.com/mwhite/6887990
[alias]
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
# staging
a = add
ac = !git add . && git commit -am
ap = add -p
# commits
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
m = commit --amend --verbose
# what happened?!
d = diff
ds = diff --stat
dc = diff --cached
s = status -s
# branch management
co = checkout
cob = checkout -b
# 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