hub で GitHub にターミナルから issue、PR を作成する

  • 0
    Like
  • 0
    Comment

    hub のインストール

    brew でもインストールできるが pre-release ではなく issue や pull-request の一部のオプションが使えないので以下 URL から最新版をインストール。

    https://github.com/github/hub/releases

    Issue を作成

    # -a assignee
    # -M milestone (ID)
    # -m message
    # -l label
    $ hub issue create \
        -a "github_account" \
        -M 83 \
        -m "This is new issue" \
        -l "My Feature","WIP"
    

    Pull Request を作成

    # -b branch name
    # -m message
    $ hub pull-request \
        -m "This is new Pull-Request" \
        -b feature/new_function
    

    ヘルプ

    $ hub issue --help  
    
    Usage: hub issue [-a <ASSIGNEE>] [-c <CREATOR>] [-@ <USER] [-s <STATE>] [-f <FORMAT>] [-M <MILESTONE>] [-l <LABELS>] [-d <DATE>] [-o <SORT_KEY> [-^]]
           hub issue create [-oc] [-m <MESSAGE>|-F <FILE>] [-a <USERS>] [-M <MILESTONE>] [-l <LABELS>]
    
    $ hub pull-request --help
    
    Usage: hub pull-request [-foc] [-b <BASE>] [-h <HEAD>] [-a <USERS>] [-M <MILESTONE>] [-l <LABELS>]
           hub pull-request -m <MESSAGE>
           hub pull-request -F <FILE> [--edit]
           hub pull-request -i <ISSUE>