LoginSignup
0
0

More than 3 years have passed since last update.

現在作業しているGitブランチに対応するPRをブラウザで開くコマンド

Posted at

現在作業しているブランチのPRが既に作られている場合、そのPRをブラウザで開く関数です。

依存

  • hubコマンド
  • openコマンド
function pr-open {
    local url=$(hub pr list -h $(git symbolic-ref --short HEAD) -f "%U")
    if [ -z "$url" ]; then
        echo "The PR based this branch not found."
        return 1
    fi
    open $url
}
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