Skip to content

Instantly share code, notes, and snippets.

@strokyl
Created September 10, 2021 08:52
Show Gist options
  • Save strokyl/d1365029634e7287cd30a70961319c4f to your computer and use it in GitHub Desktop.
Save strokyl/d1365029634e7287cd30a70961319c4f to your computer and use it in GitHub Desktop.
clean git branch
#!/bin/bash
git branch -d $(git branch --merged=master | grep -v master | grep -v develop)
git branch -d $(git branch --merged=develop | grep -v develop | grep -v master)
git fetch --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment