Skip to content

Instantly share code, notes, and snippets.

@jyore
Last active August 29, 2015 14:11
Show Gist options
  • Save jyore/2f85c189b0d69038f1c4 to your computer and use it in GitHub Desktop.
Save jyore/2f85c189b0d69038f1c4 to your computer and use it in GitHub Desktop.
Git Repo Cleaner
#!/bin/bash
# Standard Prune - Removes Branches No Longer Tracked
git fetch -p
# Will remove local branches that have already been merged
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment