Created
August 8, 2017 06:23
-
-
Save timnew/7fd20a03aec829385a0c36ad7da6d732 to your computer and use it in GitHub Desktop.
Git Clean Squashed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git-clean-squashed='git checkout -q master && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base master $branch) && [[ $(git cherry master $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment