Skip to content

Instantly share code, notes, and snippets.

@Ikloo
Last active March 16, 2018 09:21
Show Gist options
  • Save Ikloo/31de577bee5cce3e2a223c0fe1c39fdb to your computer and use it in GitHub Desktop.
Save Ikloo/31de577bee5cce3e2a223c0fe1c39fdb to your computer and use it in GitHub Desktop.
Delete all branches locally. Use with git alias. Add this snippet into .gitconfig

git-cleanup-locally

Info

Delete merged branches remote. Use with git alias.


Install

[alias]
	cleanup-locally = "!git branch | grep -v '\\*\\|master\\|develop\\|`THE_NAME_OF_THE_BRANCH`' | xargs git branch -D "

Add this snippet into .gitconfig


Usage

Run git cleanup-locally


Kirill Budevich

github.com/theikloo

@theikloo


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment