# Stole this stuff from all over the internet over the last few years.
# Thanks to everyone working hard on these things.
[alias]
# Workflow
cl = clone
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
co = checkout
cob = checkout -b
ca = !git add -A && git commit -m
cm = commit -am
ci = commit --interactive
amend = commit -a --amend
unstage = reset HEAD --
# Moving aroud
br = branch
brs = branch -a
# Merging and such things
cp = cherry-pick
stashes = stash list
pop = stash pop
ours = !"f() { git checkout --ours $@ && git add $@; }; f"
theirs = !"f() { git checkout --theirs $@ && git add $@; }; f"
# Logs and status
st = status -sb
dc = diff --cached
last = log -1 --stat
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue<%an>%Creset' --abbrev-commit --date=relative --all
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local
# Github Flow
bclean = "!f() { git checkout ${1-develop} && git branch --merged ${1-develop} | grep -v " ${1-develop}$" | xargs git branch -d; }; f"
bdone = "!f() { git checkout ${1-develop} && git up && git bclean ${1-develop}; }; f"
# Repository optimization
pruner = !git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all
repacker = !git repack -a -d -f --depth=300 --window=300 --window-memory=1g
# Dangerous
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
killit = reset HEAD --hard
Comments