---
title: "Comment by Chaim Lev-Ari on \"Git Tip: Deleting merged branches locally\" | Hashnode"
description: "this should also work: git config -- global alias.cleanup \"!git branch --merged | grep -v '\\\\*\\\\|master\\\\|development|develop' | xargs -n 1 git branch -d\" I als"
url: "https://hashnode.com/posts/git-tip-deleting-merged-branches-locally/58cbbaa7c3bad5e2e0c59d32/comment/593782659adb0ce3807ef36f"
---

[Discussion](https://hashnode.com/posts/git-tip-deleting-merged-branches-locally/58cbbaa7c3bad5e2e0c59d32)

Comment [Git Tip: Deleting merged branches locally](https://hashnode.com/posts/git-tip-deleting-merged-branches-locally/58cbbaa7c3bad5e2e0c59d32)

[Chaim Lev-Ari](https://hashnode.com/@chiptus)

[Jun 7, 2017](https://hashnode.com/posts/git-tip-deleting-merged-branches-locally/58cbbaa7c3bad5e2e0c59d32/comment/593782659adb0ce3807ef36f)

this should also work:

```
git config --global alias.cleanup "!git branch --merged | grep  -v '\\*\\|master\\|development|develop' | xargs -n 1 git branch -d"
```

I also added develop branch because that what we mostly call it instead of development
