LoginSignup
0
0

More than 1 year has passed since last update.

【備忘録】プルリク(Pull Request)の手順

Last updated at Posted at 2021-08-18

手順

1. GitHubでリポジトリのメインページにアクセス

2. Codeボタンをクリック

3. URLをコピー

Clone with HTTPSの下にあるURLをコピー。

4. ターミナルを開く

5. カレントワーキングディレクトリをクローンしたい場所に変更

(例)
cd ~/project

6. git clone と入力して前の手順でコピーしたURLを貼り付ける

(例)
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY

7. Enterを押してローカルクローンを作成

(例)
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
> Cloning into `Spoon-Knife`...
> remote: Counting objects: 10, done.
> remote: Compressing objects: 100% (8/8), done.
> remove: Total 10 (delta 1), reused 10 (delta 1)
> Unpacking objects: 100% (10/10), done.

8. Pull Request用のBranchを作成

①cloneしたディレクトリに移動
$ cd ~/project/YOUR-REPOSITORY

②developという名前のBranchを作成
$ git checkout -b development

9. Cloneしたディレクトリを編集

①現在のフォルダをVSCodeで表示
$ code .

②編集
略

10. ローカルでadd⇒commit、Githubへpushする

①編集ファイルをステージングに移す
$ git add .

②編集ファイルをcommitする
(例)
$ git commit -m "modified README"

③developブランチからGithub上のoriginブランチにpushする
$ git push origin development

11. Github上でPullRequest

①右上の緑色のCompare & pull requestボタンをクリック

②どういった変更を加えたのかを説明する内容を記入
(例)コメントにHello!!!をつけました

③どのブランチからどのブランチにpull requestするかを確認する
※developブランチからmasterブランチへのpull request

④緑色の[Create pull request]ボタンを押して、Pull Requestを作成

12. Github上でMergeする

※通常この作業は、自分以外のレポジトリ管理者がコードを確認して実行する。

①左下の緑色の[Merge pull request]ボタンを押して、Mergeを実行する

これで本番環境に反映される。

▼参考にさせていただいた記事

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