LoginSignup
0
0

More than 5 years have passed since last update.

【メモ】コマンドラインからPull Requestを出すシェル関数

Posted at

できること

現在のローカルブランチから引数で与えたブランチへGithub上にPull Requestを出す。

使用例

opr master

内容

# 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/* /}
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0