Skip to content

Instantly share code, notes, and snippets.

@Teemu
Created January 23, 2019 11:33
Show Gist options
  • Save Teemu/aedb934fdea506afdfaed99313b05fef to your computer and use it in GitHub Desktop.
Save Teemu/aedb934fdea506afdfaed99313b05fef to your computer and use it in GitHub Desktop.
Open a pull request in Github
from sh import git, open
branch = git('rev-parse', '--abbrev-ref', 'HEAD').strip()
location = git('remote', 'get-url', 'origin').split('[email protected]:')[1].split('.git')[0]
url = 'https://github.com/%s/compare/%s?expand=1' % (
location,
branch
)
open(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment