From 5d333bee794bb9a470346f5be7c5a974d2161105 Mon Sep 17 00:00:00 2001 From: Nicco Date: Mon, 20 Jan 2025 11:46:37 +0100 Subject: [PATCH] Create remove-merged-branches --- pages/git/remove-merged-branches | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/git/remove-merged-branches diff --git a/pages/git/remove-merged-branches b/pages/git/remove-merged-branches new file mode 100644 index 0000000..3c0df73 --- /dev/null +++ b/pages/git/remove-merged-branches @@ -0,0 +1,20 @@ +--- +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) + + +