Skip to content

Instantly share code, notes, and snippets.

@kristw
Last active September 2, 2020 17:54
Show Gist options
  • Save kristw/ccde9f775cecb73c03d9 to your computer and use it in GitHub Desktop.
Save kristw/ccde9f775cecb73c03d9 to your computer and use it in GitHub Desktop.
git alias
; from this article http://haacked.com/archive/2014/07/28/github-flow-aliases/
[alias]
aa = add -A
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
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
mylog = log --author="kristw"
fm = fetch origin master:refs/remotes/origin/master --no-tags
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 -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment