Skip to content

Instantly share code, notes, and snippets.

@KangYoosam
Created February 18, 2018 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KangYoosam/c163813cb4641d1d8f5e62baabee3818 to your computer and use it in GitHub Desktop.
Save KangYoosam/c163813cb4641d1d8f5e62baabee3818 to your computer and use it in GitHub Desktop.
【メモ】コマンドラインからPull Requestを出すシェル関数 ref: https://qiita.com/kangyoosam/items/67f30ca49a275732349d
# opens a PR from the current branch
function opr() {
parentBranch=$1
currentBranch=`git branch | grep "*"`
repoName=$(git remote show origin -n | ruby -ne 'puts /^\s*Fetch.*:(.*).git/.match($_)[1] rescue nil')
open -a /Applications/Google\ Chrome.app https://github.com/${repoName/* /}/compare/${parentBranch/* /}...${br/* /}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment