Skip to content

Instantly share code, notes, and snippets.

@Zenahr
Created May 28, 2020 08:05
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 Zenahr/22f5d376346c20d86642d772f0afe98e to your computer and use it in GitHub Desktop.
Save Zenahr/22f5d376346c20d86642d772f0afe98e to your computer and use it in GitHub Desktop.
[Git] delete local branches which do not have an equivalent on remote anymore (i.e. after merging)
git branch -vv (Check for the "gone" keyword)
git branch -d [branch-name]
voila, local garbage collection done.
This is the only safe and simple way to do this just using high-level git commands without scripting complicated and perhaps hazardous regex-based commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment