Created
February 11, 2016 23:14
-
-
Save balloob/a870128378bd17304199 to your computer and use it in GitHub Desktop.
Code to paste into console with GitHub open to remove branches whose PRs are merged, closed or are 0 commits ahead
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
Array.prototype.slice.call(document.getElementsByClassName('js-branch-row')) | |
.filter(el => el.getElementsByClassName('state-merged').length > 0 || | |
el.getElementsByClassName('state-closed').length > 0 || | |
el.getElementsByClassName('count-ahead')[0].innerHTML == '0') | |
.forEach(el => el.getElementsByClassName('branch-delete')[0].click()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment