Skip to content

Instantly share code, notes, and snippets.

@colinodell
Created March 19, 2018 14:36
Show Gist options
  • Save colinodell/89ee20346628d4f31aca4a7118b159a0 to your computer and use it in GitHub Desktop.
Save colinodell/89ee20346628d4f31aca4a7118b159a0 to your computer and use it in GitHub Desktop.
Git Aliases
[alias]
p = "!git pull --ff-only"
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autostash --autosquash $REV^' -
cleanup = "!git branch --merged | grep -v -P '^\\*|master|develop' | xargs -n1 -r git branch -d"
children = "!bash -c 'c=${1:-HEAD}; set -- $(git rev-list --all --not \"$c\"^@ --children | grep $(git rev-parse \"$c\") ); shift; echo $1' -"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment