Skip to content

Instantly share code, notes, and snippets.

@benjaminwy
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save benjaminwy/d6c0eca5ed5316375ed9 to your computer and use it in GitHub Desktop.

Select an option

Save benjaminwy/d6c0eca5ed5316375ed9 to your computer and use it in GitHub Desktop.
Useful git aliases
[user]
name = Your Name
email = your.email@address.com
[alias]
# List aliases
la = "!git config -l | grep alias | cut -c 7-"
# Shorthand
c = commit -m
a = add -A
s = status
cob = checkout -b
ac = !git add -A && git commit -m
# List commits in short form with colors and branch/tag annotations
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
# List commits showing changed files
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
# List one-line commits showing dates
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
# List one-line commits showing relative dates
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
# Short git log
le = log --oneline --decorate
# Show modified files in last commit
dl = "!git ll -1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment