---
title: "删除已 merge 的 git branch"
description: "删除所有已经 merge 的本地 git branch 的实用 git 命令 git branch --merged | egrep -v \"(^\\\\|master|dev)\" | xargs git branch -d*"
canonical: https://oozou.com/til/delete-merged-git-branches-51
locale: zh-Hans
date: 2020-10-13
topic: shell
---

# 删除已 merge 的 git branch

> 删除所有已经 merge 的本地 git branch 的实用 git 命令 git branch --merged | egrep -v "(^\\|master|dev)" | xargs git branch -d*

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hans/til-topics/shell) ([markdown](https://oozou.com/zh-Hans/til-topics/shell.md))

删除所有已经 merge 的本地 git branch 的实用 git 命令
*git branch --merged | egrep -v "(^\\*|master|dev)" | xargs git branch -d*

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hans/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
