Menu

gitpiper

Delete detached branches git Code Snippet in 2025

repositorybranchintermediate

Last Updated: 24 April 2025

Deletes all detached branches.

  • Use git fetch --all --prune to garbage collect any detached branches.
  • This is especially useful if the remote repository is set to automatically delete merged branches.
git fetch --all --prune
git checkout master git branch # master # patch-1 # patch-2 # Assuming `patch-1` is detached git fetch --all --prune git branch # master # patch-2

git snippet similar to Delete detached branches For You in April 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️