Skip to content

Instantly share code, notes, and snippets.

@cxmcc cxmcc/nuke-branch.js
Created Mar 21, 2017

What would you like to do?
Nuke all Closed and Merged branches on a github web page.
// Paste into console
// Need to disable Content Security Policy in your browser
var jq = document.createElement('script');
jq.src = "";
var branch_actions = $('.branch-actions');
$.each(branch_actions, function() {
var first_child = this.children[0];
if (first_child != undefined && $(first_child).attr('class') == 'pr-details') {
var state = $(first_child.children[1]);
var klass = state.attr('class');
if (klass == "state state-closed" || klass == "state state-merged") {
var form = this.children[1];
var button = form.children[1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.