Every day I create a few pull request on Github and I wanted a way to simplify creating a PR. I tested out a few Emacs packages that integrate against Github API but I didn’t get them to work because we use 2 factor authentication (if anyone can help, tweet me :) ). So I decided to write a simple function that takes me to the PR page for the current repo (requires magit). Here you go:

(defun gh-pr ()
  "go to github pull request page for current repo"
  (interactive)
  (browse-url (concat (replace-regexp-in-string ".git$" "" (magit-get "remote" "origin" "url")) "/pulls")))