Skip to content

Instantly share code, notes, and snippets.

@andreadottor
Last active August 1, 2023 16:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreadottor/70ec9e63f812a0a331748a695184da26 to your computer and use it in GitHub Desktop.
Save andreadottor/70ec9e63f812a0a331748a695184da26 to your computer and use it in GitHub Desktop.
Git Aliases
[core]
editor = code --wait
[alias]
co = checkout
st = status
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
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { DEFAULT=$(git default); git branch --merged ${1-$DEFAULT} | grep -v " ${1-$DEFAULT}$" | xargs git branch -d; }; f"
bdone = "!f() { DEFAULT=$(git default); git checkout ${1-$DEFAULT} && git up && git bclean ${1-$DEFAULT}; }; f"
open = "!f() { REPO_URL=$(git config remote.origin.url); explorer ${REPO_URL%%.git}; }; f"
browse = !git open
last = 'log -1 HEAD --stat'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment