Skip to content

Instantly share code, notes, and snippets.

@mattmanning
Created June 15, 2021 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmanning/0c9b069d6c2fbd418a4acf7cb047096e to your computer and use it in GitHub Desktop.
Save mattmanning/0c9b069d6c2fbd418a4acf7cb047096e to your computer and use it in GitHub Desktop.
#!/bin/sh
# Fetch new remote branches, prune deleted remote branches
git remote update -p
# Delete local branches for which the remote branch has been deleated
git branch --merged | awk '/^ /' | xargs -I $ git branch -d $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment