GitHub helpfully prompts you to create a pull request after pushing a new branch. Unhelpfully, it always suggests PRing against master
(or develop
or whatever your main branch is). This Tampermonkey/ Greasemonkey script adds a "Compare & pull request (current branch)" button that will bring you to the PR creation page already comparing against the branch you're currently on.
- Install the Tampermonkey extension for Chrome or Greasemonkey extension for Firefox
- Restart your browser
- Click on the "Raw" button of the
github-pr-against-current-br.user.js
file below - Tampermonkey/Greasemonkey should pick up the fact that it's a
*.user.js
file and prompt you to install. Click "Install" - Push an update to a branch (or push a new branch)
- On GitHub.com, navigate to the tree you want to PR against using the "Branch" dropdown (if you're already on the branch, refresh the page)
- Click on "Pull request (current branch)"
- Save time
- Get it to listen to changes to the DOM so that it can add itself when GitHub detects a branch (currently requires the branch to be available on page load)
- Create a Chrome extension
- Create a Firefox extension
- Encourage GitHub to add this functionality natively