{"id":1453,"date":"2022-04-28T19:09:40","date_gmt":"2022-04-28T19:09:40","guid":{"rendered":"https:\/\/kalkus.dev\/?p=1453"},"modified":"2023-08-24T23:32:47","modified_gmt":"2023-08-24T23:32:47","slug":"how-to-delete-unused-local-branches-in-git","status":"publish","type":"post","link":"https:\/\/kalkus.dev\/blog\/2022\/04\/28\/how-to-delete-unused-local-branches-in-git\/","title":{"rendered":"How to delete unused local branches in Git?"},"content":{"rendered":"\n<p>To remove unused local Git branches we can utilize git-removed-branches npm package.<\/p>\n\n\n\n<p><strong>First install it:<\/strong><\/p>\n\n\n\n<p><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">npm install -g git-removed-branches<\/code><\/p>\n\n\n\n<p><strong>Then if you want to detect stale branches run:<\/strong><\/p>\n\n\n\n<p><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">git removed-branches<\/code><\/p>\n\n\n\n<p><strong>To remove them run:<\/strong><\/p>\n\n\n\n<p><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">git removed-branches \u2013prune <\/code><\/p>\n\n\n\n<p>The command will remove local branches which have been deleted on remote repository.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To remove unused local Git branches we can utilize git-removed-branches npm package. First install it: npm install -g git-removed-branches Then if you want to detect stale branches run: git removed-branches To remove them run: git removed-branches \u2013prune The command will remove local branches which have been deleted on remote repository.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[202],"tags":[],"_links":{"self":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts\/1453"}],"collection":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/comments?post=1453"}],"version-history":[{"count":3,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts\/1453\/revisions"}],"predecessor-version":[{"id":1457,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/posts\/1453\/revisions\/1457"}],"wp:attachment":[{"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/media?parent=1453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/categories?post=1453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kalkus.dev\/blog\/wp-json\/wp\/v2\/tags?post=1453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}