Skip to content

Instantly share code, notes, and snippets.

@garrickp
Created May 14, 2015 19:57
Show Gist options
  • Save garrickp/eadff3cc8fce1230523d to your computer and use it in GitHub Desktop.
Save garrickp/eadff3cc8fce1230523d to your computer and use it in GitHub Desktop.
Git Aliases
[alias]
co = checkout
s = status
b = branch
a = add
c = commit
d = diff --ignore-space-at-eol --ignore-blank-lines
ec = config --global -e
up = !git pull --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit
pushn = "!git push --set-upstream origin $(git branch | awk '/^\\*/ {print $2};')"
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
[push]
default = simple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment