mirror of
https://github.com/cupcakearmy/memoir.git
synced 2026-04-06 21:59:23 +00:00
update deps & add cleanup of local brnaches
This commit is contained in:
28
content/git/clean-local-branches.md
Normal file
28
content/git/clean-local-branches.md
Normal 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)
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
tags:
|
||||
- git
|
||||
- branch
|
||||
- clean
|
||||
- delete
|
||||
---
|
||||
|
||||
# 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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user