1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 09:08:01 +00:00

Add Clean Out All Local Branches as a git til.

This commit is contained in:
jbranchaud
2015-03-31 20:09:12 -05:00
parent 18e417fff8
commit e6d7e74341
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# Clean Out All Local Branches
Sometimes a project can get to a point where there are so many local
branches that deleting them one by one is too tedious. This one-liner can
help:
```
$ git branch --merged master | grep -v master | xargs git branch -d
```
This won't delete branches that are unmerged which saves you from doing
something stupid, but can be annoying if you know what you are doing. If you
are sure you want to wipe everything, just use `-D` like so:
```
$ git branch --merged master | grep -v master | xargs git branch -D
```