Skip to content

Instantly share code, notes, and snippets.

@darrennolan
Created February 24, 2016 00:21
Show Gist options
  • Save darrennolan/22cde0c04db4c4ce7340 to your computer and use it in GitHub Desktop.
Save darrennolan/22cde0c04db4c4ce7340 to your computer and use it in GitHub Desktop.
[alias]
delete-merged-branches = "!f() { git checkout --quiet develop && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f"
owc = !vim -O `git whatchanged -n1 | grep ^: | awk '{print $NF}'`
om = !vim -O `git st | grep 'modified:' | awk '{print $NF}'`
omn = !vim -O `git st | egrep -w 'modified:|new file:' | awk '{print $NF}'`
com = !git checkout `git st | grep modified | awk '{print $3}'`
ai = add -i
ap = add -p
rb = rebase -i
co = checkout
br = branch
ci = commit --verbose
st = status
srb = svn rebase && grater update && grater list
slog = svn log --show-commit
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(green)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit --date=relative
ll = !git log --stat
lgp = !git lg -p
lll = !git log --stat -n 1
me = !git lg --author=tquilkey
wk = !git me --since='+7 days'
month = !git me --since='+1 Month'
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ => \\2/' | sort
uf = !git checkout $(git status | grep modified | awk '{print $3}')
usa = !git reset HEAD $(git status | grep modified | awk '{print $3}')
us = !git reset HEAD $1
bn = !git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \\(.*\\)/\\1/'
export-patch = !git format-patch --stdout $1 > ~/`git bn`.diff
#wf = !git-workflow
#pack-mod = !~/bin/pack-mod.sh
todo = !ugrep -e TODO
ar = !sh 'git branch -M $1 archived/$1' -
wc = !git whatchanged
wcp = !git whatchanged -p
d = diff
dc = diff --cached
last = cat-file commit HEAD
lol = log --graph --decorate --pretty --oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
[core]
excludesfile = ~/.gitignore
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = less -x4
[color]
ui = true
[color "branch"]
current = green
local = blue
remote = red
[color "diff"]
meta = yellow
frag = magenta
old = red bold
new = green
[color "status"]
added = green
changed = yellow
untracked = red
[color "diff"]
whitespace = red reverse
[push]
default = current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment