Skip to content

Instantly share code, notes, and snippets.

@jost125
Last active August 2, 2021 11:31
Show Gist options
  • Save jost125/7006654 to your computer and use it in GitHub Desktop.
Save jost125/7006654 to your computer and use it in GitHub Desktop.
Checkouts to master and delete all fully merged branches
#!/bin/bash
git checkout master
for b in $(git branch | grep -v master); do git branch -d $b; done
git fetch -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment