Skip to content

Instantly share code, notes, and snippets.

@KerryRitter
Created May 30, 2019 13:27
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 KerryRitter/7583781a1d68af95854fcdf0b15c2890 to your computer and use it in GitHub Desktop.
Save KerryRitter/7583781a1d68af95854fcdf0b15c2890 to your computer and use it in GitHub Desktop.
Git Aliases
[alias]
co = checkout
cob = checkout -b
br = branch
st = status
branch-name = !git rev-parse --abbrev-ref HEAD
cm = !git add -A && git commit -m
cmb = !git add -A && git commit -m "$(git branch-name)" -m
publish = !git push -u origin $(git branch-name)
unpublish = !git push origin :$(git branch-name)
count = !git shortlog -sn
re-ignore = !git rm --cached -r . && git add -A
ec = config --global -e
up = !git fetch --prune && git pull --rebase --prune $@ && git submodule update --init --recursive
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"
#for *nix
open = !open `git config remote.origin.url`
browse = !git open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment