Skip to content

Instantly share code, notes, and snippets.

@phstc phstc/README.md
Last active May 20, 2019

Embed
What would you like to do?
Browse a GitHub pull request based on the branch name
  1. download gpr into ~/bin
  2. change org and repo in the script
  3. chmod +x ~/bin/gpr
  4. edit ~/.zshrc adding export PATH="$HOME/bin:$PATH"
  5. cd your-cloned-dir then gpr
#!/usr/bin/env ruby
branch = `git branch`.split("\n").map(&:strip).find { |branch| branch.start_with?('*') }.delete('* ')
# TODO: get the organization and repo based on `git remote -v`
url = "https://github.com/org/repo/pull/#{branch}"
`open "#{url}"`
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.