Skip to content

Instantly share code, notes, and snippets.

@phstc phstc/
Last active May 20, 2019

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 = "{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.