---
title: "Discussion on \"Git Tip: Deleting merged branches locally\" | Hashnode"
description: "Discussion on \"Git Tip: Deleting merged branches locally\". As a part of our spring cleaning drive in our remote repo, we found and deleted a lot of leftover merged branches.\nI wanted to find a quick way to do the same locally, and I happened at an answer, which I've written down below, to save it as a quick ..."
url: "https://hashnode.com/posts/git-tip-deleting-merged-branches-locally/58cbbaa7c3bad5e2e0c59d32"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Git Tip: Deleting merged branches locally](https://saiki.hashnode.dev/git-tip-deleting-merged-branches-locally?utm_source=hashnode&utm_medium=feed)

As a part of our spring cleaning drive in our remote repo, we found and deleted a lot of leftover merged branches. I wanted to find a quick way to do the same locally, and I happened at an answer, which I've written down below, to save it as a quick ...

Mar 17, 2017 · 1 min read · saiki.hashnode.dev  
Updated Apr 30, 2022  
Read the article

-   [#git](https://hashnode.com/tag/git)

## Written by

[Sai Kishore Komanduri](https://hashnode.com/@saiki)

@saiki · Bangalore, India

  
[View profile](https://hashnode.com/@saiki)

Engineering an eGovernance Product | Hashnode Alumnus | I love pixel art

I have been in love with computers and everything related since I played my first game of Dangerous Dave back in the 90s. Graduating with a master&#39;s degree in Biology, and a bachelor&#39;s in Pharmacy; I have been fortunate enough to dabble my hands in things ranging from copywriting to computer networks. I love pixel art! I&#39;ve written a few more things about me, here and here !

## Responses 1

Markdown supported · ⌘↵ to post

[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
