LoginSignup
3
3

More than 5 years have passed since last update.

hub pull-request -i n -b branch が失敗する

Posted at

現象

なんどやっても失敗するんですね.

$ hub pull-request -i 9 -b develop
Warning: Issue to pull request conversion is deprecated and might not work in the future.
Error creating pull request: Unprocessable Entity (HTTP 422)
Not allowed to change field "issue"

とか,develop のところを upstream である sasarky/ipuhubot とかいろいろ変えてみましたが状況は変わらず...

原因

githubアカウントを2つ持っているのですが,hub コマンドを想定と異なるユーザと連携していました...orz

今回の操作の場合,issue を発行したユーザでなければ,PullRequest に付け替えることができないので Not allowed なんですね.

hub コマンドは初回実行時にアカウントとパスワードを聞かれると思います.パスワードは保存されませんが,アカウントとOAuthトークンは ~/.config/hub に保存されています.

対処

~/.config/hub を削除するともう一度ログインを尋ねられるので,

rm ~/.config/hub

でいったん削除してから hub コマンドを実行すると正しく動作しますた

$ hub pull-request -i 9 -b sasarky:ipuhubot/develop
github.com username: isseium
github.com password for isseium (never stored):
deprecated and might not work in the future.
https://github.com/sasarky/ipuhubot/pull/9
3
3
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
3
3