Skip to content

Instantly share code, notes, and snippets.

@shadyvb
Created October 2, 2013 12:01
Show Gist options
  • Save shadyvb/6792634 to your computer and use it in GitHub Desktop.
Save shadyvb/6792634 to your computer and use it in GitHub Desktop.
Default to pull-request to develop branch instead of master on github
// ==UserScript==
// @name Compare pull-requests against develop branch instead of master branch
// @namespace http://sharaf.me/
// @version 0.1
// @match https://github.com/*/compare/issue*
// @copyright 2013+, Shady Sharaf
// @run-at document-start
// ==/UserScript==
window.location.href = window.location.href.replace('compare/issue', 'compare/develop...issue')
@westonruter
Copy link

What about:

window.location.replace( window.location.href.replace('compare/issue', 'compare/develop...issue') )

And then what if the repo you're looking at doesn't have a develop branch, or if is named development? Would this cause you to always go to a 404?

@shadyvb
Copy link
Author

shadyvb commented Oct 2, 2013

Since is stone-age anyway.. but i think i'll do a small popup, on clicking a button, placed anywhere on the settings page for a repo, that will give you the choice of which branch should be set as the default base branch for pull-requests .. which stores in a cookie and be used later on redirection ..

Shouldn't be hard to do i think ..

@westonruter
Copy link

That would be awesome! Better yet would be to use localStorage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment