Skip to content

Instantly share code, notes, and snippets.

@vilinski
Created March 8, 2019 11:40
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 vilinski/ecddb1b895e1ed627190ca0e21f94da9 to your computer and use it in GitHub Desktop.
Save vilinski/ecddb1b895e1ed627190ca0e21f94da9 to your computer and use it in GitHub Desktop.
git cleanup
[alias]
# view list of merged feature branches
lscleanup = "!git branch -r --merged | grep -e 'feature\\|component' | sed 's/origin\\///'"
# delete merged feature branches local and on origin
cleanup = "!git branch -r --merged | grep -e 'feature\\|component' | sed 's/origin\\///' | xargs -n 1 git push --delete origin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment