update deps & add cleanup of local brnaches

This commit is contained in:
2026-04-05 11:14:53 +02:00
parent fc5e57305e
commit 558d2c3e30
4 changed files with 667 additions and 718 deletions

View File

@@ -0,0 +1,28 @@
---
tags:
- git
- branch
- clean
- delete
---
# Clean up local branches
## Delete all local branches that are already merged.
This command is useful if you have a buch of local branches that you don't need anymore.
```bash
git branch --merged | grep -v \* | xargs git branch -D
```
[Original SO Link](https://stackoverflow.com/a/10610669)
## Delete all other local branches
This command will delete all local branches except the one you are currently on.
```bash
git branch | grep -v "$(git rev-parse --abbrev-ref HEAD)" | xargs git branch -D
```
[Source](https://dev.to/vineethtrv/how-to-delete-all-local-git-branches-except-the-current-one-5dcb)