まとめ

Git中級

George Boorman

Curriculum Manager, DataCamp

ブランチとは

バグ修正、AIアシスタント、mainブランチにコミットとマージがある画像

Git中級

ブランチを操作する

  • すべてのブランチを表示
git branch
  • 既存ブランチに切り替える
git switch hotfix
  • 新しいブランチを作成して切り替える
git switch -c hotfix
  • 2つのブランチを比較する
git diff main hotfix
  • ブランチ名を変更する
git branch -m hotfix bugfix
  • ブランチを削除する
git branch -d hotfix
Git中級

ブランチをマージする

  • mainから、ai-assistantmainにマージする:
git merge ai-assistant
  • 別のブランチから:git merge source destination
git merge ai-assistant main
  • マージ時のコンフリクト対応
Git中級

リモートを使った共同作業

  • リモートリポジトリをクローンする
git clone https://github.com/datacamp/project
  • すべてのリモートに関する情報を取得する
git remote -v
  • 新しいリモートを追加する
git remote add george https://github.com/george_datacamp/repo 
Git中級

ローカルリポジトリとリモートリポジトリの同期

git fetch origin
git pull origin
git push origin documentation
Git中級

次のステップ

Git中級

練習しましょう!

Git中級

Preparing Video For Download...