Skip to content

Instantly share code, notes, and snippets.

@koehn
Created December 7, 2013 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koehn/7847041 to your computer and use it in GitHub Desktop.
Save koehn/7847041 to your computer and use it in GitHub Desktop.
GitConfig with a lot of handy aliases I've come to love.
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
type = cat-file -t
dump = cat-file -p
undo = reset --hard
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
add-no-iml = !git add `git status -s --untracked-files=no | cut -c 4- | grep -v \\.iml`
checkout-iml = !git checkout `git status -s | cut -c 4- | grep \\.iml`
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
dl = "!git ll -1"
dlc = diff --cached HEAD^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment