Deleting branches already merged to main

almirsarajcic

almirsarajcic

Created 7 months ago

If you’ve been working on an app for a while, you probably have many stale local branches. To remove them, run this command

git branch --merged main \
  | grep -v 'main$' \
  | xargs git branch -d