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

Gitでレビュー時にチェックアウト→サンプルソース作成→ドラフトPR作成の手順

Posted at

はじめに

PRレビューでサンプルソースのドラフトPRを作ることがあります。

コマンドをすぐ忘れちゃうので、この流れをメモっておこうかと思います。

シチュエーション

レビュー依頼が来たー!
あ、ソース量が多いからチェックアウトしてみたいなー。
あれ?ここの部分は、うーん。

よし、サンプルソースを作ってドラフトPRをお見せしようー!

やりたきことの流れ

1.チェックアウト
2.チェックアウトしたブランチからさらにブランチを作成
3.作成したブランチにスイッチ
4.ファイルを修正してプッシュ
5.ドラフトPRを作成

事前準備

GitHub上で、feature/review-A ブランチを作成

やってみる

リモートのブランチを取得

git fetch
git checkout feature/review-A

ブランチを作って、ファイルを修正して、プッシュ

git branch feature/review-A-refactor
git switch feature/review-A-refactor
echo 'modify' >> review-A-refactor.txt
git add review-A-refactor.txt
git commit -m 'modify'
git push origin feature/review-A-refactor

ghコマンドでドラフトPR作成

gh pr create
※ Submit as draft を選択
gh pr view --web
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?