Skip to content

Instantly share code, notes, and snippets.

@42atomys
Created August 26, 2022 15:52
Show Gist options
  • Save 42atomys/3b938fc25f07ce8ddd96b813facd6442 to your computer and use it in GitHub Desktop.
Save 42atomys/3b938fc25f07ce8ddd96b813facd6442 to your computer and use it in GitHub Desktop.
Git alias sugar
git config --system alias.fetch-clean "\!f() { git branch --v | grep '\[gone\]' | awk '{print $1}' | xargs git branch -D; }; f"
git config --system alias.amend-to '!f() { SHA=`git rev-parse "$1"`; git commit --fixup "$SHA" && GIT_SEQUENCE_EDITOR=true git rebase --interactive --autosquash "$SHA^"; }; f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment