GitHubからプロジェクトを取得(クローン)
方法①: HTTPS を使う
git clone https://github.com/ユーザー名/リポジトリ名.git
方法②: SSH を使う(SSH 設定済みの場合)
git clone git@github.com:ユーザー名/リポジトリ名.git
クローン後は、作業フォルダへ移動
cd sample-project
git branch
方法①: HTTPS を使う
git clone https://github.com/ユーザー名/リポジトリ名.git
方法②: SSH を使う(SSH 設定済みの場合)
git clone git@github.com:ユーザー名/リポジトリ名.git
クローン後は、作業フォルダへ移動
cd sample-project
git branch
✅ 方法①: ターミナルで作成
git checkout -b feature-branch
または
git switch -c feature-branch
git branch
✅ 方法②: VS Code の GUI で作成
VS Code の左下にあるブランチ名をクリック → 「+ Create New Branch」を選択
✅ ファイルを変更して保存
git add .
git commit -m "新しい機能を追加"
git push origin feature-branch
✅ GitHub で「Pull requests」タブをクリック → 「New pull request」ボタンをクリック
feature-branch → main を選択
「Create pull request」
git branch -d feature-branch