2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GithubのDraft Pull RequestをCLIで作りたい

Posted at

要約

GithubにサクッとDraftでPR作りたいだけなのにいちいちブラウザ開いてDraftを指定してPRを作るのが正直めんどいのでCLIでポチッとやるだけで作りたい。DraftでもPull Requestのテンプレートはちゃんと適用したい。

gh を入れて以下のコマンドでAliasを登録するだけでハッピーになれる!!!

gh alias set draft 'pr create --draft --fill --body-file .github/PULL_REQUEST_TEMPLATE.md'

今まで

  • git add hoge
  • git commit -m "hoge"
  • git push origin hoge
  • https://github.com/tomtwinkle/xxxx/pull/new/hoge でブラウザ開く ←めんどくさい
  • Create Pull RequestをDraftに選択する ←こいつが地味にめんどくさい
  • Create Pull Requestを押す ←めんどくさい
  • DraftでPull Requestが出来た!

これから

  • git add hoge
  • git commit -m "hoge"
  • gh draft
  • forkしてる場合はpushするRepositoryを選ぶ
  • DraftでPull Requestが出来た!

Happy Hacking!!

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?