Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Userscript to disable the Merge button inside pull requests on certain github projects
// ==UserScript==
// @name Hide GitHub Merge Button
// @version 0.5
// @description Removes the merge button on a GitHub project, so you will remember to
// rebase/write a useful merge message.
// @match*/pull/*
// #updateURL
// ==/UserScript==
var main = function () {
var clearMergeButton = function() {
document.querySelector('.btn-group-merge').style.display = 'none';
document.querySelector('.btn-group-squash').style.display = 'none';
document.querySelector('.btn-group-squash').style.display = 'none';
setTimeout(clearMergeButton, 500);
// Merge button gets reset after you add a comment for some reason, so hide it then too
form = document.querySelector('form.js-new-comment-form')
form.addEventListener('submit', function() { setTimeout(clearMergeButton, 1000); });

This comment has been minimized.

Copy link

vpodzime commented Oct 19, 2015

'.merge-branch-action' needs to be '.js-merge-branch-action' now. But thanks for sharing this!


This comment has been minimized.

Copy link
Owner Author

aripollak commented Oct 26, 2015

@vpodzime updated, thanks!

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.