Created
March 13, 2017 14:15
-
-
Save almirsarajcic/3b044058948d2c0f68399e8aef9a0afa to your computer and use it in GitHub Desktop.
Remove branches from the GitHub repo
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
var preservedBranches = [ | |
'master', 'develop' | |
]; | |
// Remove branches on the current page | |
var branches = document.getElementsByClassName('branch-summary'); | |
for (var i = 0; i < branches.length; i++) { | |
var branchName = branches[i].dataset.branchName; | |
if ( ! preservedBranches.includes(branchName)) { | |
branches[i].getElementsByClassName('branch-delete')[0].click(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment