Files
30-seconds-of-code/snippets/delete-detached-branches.md
Isabelle Viktoria Maciohsek ee28929328 Make expertise a field
2022-03-01 20:23:46 +02:00

573 B

title, tags, expertise, firstSeen, lastUpdated
title tags expertise firstSeen lastUpdated
Delete detached branches repository,branch intermediate 2021-04-08T19:42:01+03:00 2021-04-13T21:10:59+03:00

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