1
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上で作成したリポジトリをCloud9にcloneし、PRを作成するまでの流れ

Last updated at Posted at 2023-03-28

Cloud9へのcloneまで

①GitHubにログインして、新しいリポジトリを作成します。リポジトリ名は任意のものを設定し、Public(公開設定)にします。

②Cloud9の開発環境に移動し、ターミナルを開き、

$ cd ~/environment

を実行して、カレントディレクトリを開発環境のルートディレクトリに変更します。

③git clone を実行して、GitHub上のリポジトリをCloud9にクローンします。

Cloud9ならSSHのurl

$ git clone <リモートリポジトリのURL>

④以下のコマンドでクローンしたリポジトリのディレクトリに移動します。

$ cd <リポジトリ名>

⑤リモートリポジトリにまだブランチがない場合、

$ git push -u origin main

を実行して、"main"という名前の新しいブランチを作成します。
⑥続いて

$ cd git checkout -b <新規ブランチ>

を実行し新規ブランチに切り替えます。
⑦続いて

$ touch <新規ファイル>.md

を実行して、"新規ファイル"というファイルを作成します。

PRまでの流れ

①ローカルの編集中のブランチに移動する。

$ git checkout <編集中のブランチ名>

②ファイルをGitのステージング領域に追加するために

$ git Add <編集中のファイル>

③コミットメッセージを記述してコミットします。

git commit -m "変更内容のメッセージ"

④pushします。

git push origin <編集中のブランチ名>

以上でcloneしたリポジトリの編集、PRの作成まで行えると思います。
拙い記述でしたがもし間違いなどあればご指摘いただけますと幸いです。

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