Skip to content

nekko-lab/git-handson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git/GitHub ハンズオン

Part 1: ローカルで Git コマンド操作を体験する

想定する環境

  • Linux, Unix, macOS, WSL

Part 1 目的

  • Git の基本操作(clone, branch, commit, push, merge, status, log)を理解する
  • GitFlow 運用に必要なコマンドを一通り実行できるようにする

Part 1 ハンズオン

  1. リポジトリの初期化と clone

    git clone https://github.com/<your-org>/<hands-on-repo>.git
    cd hands-on-repo
  2. ブランチ確認

    git branch -a
  3. feature ブランチ作成 & 作業

    git checkout -b feature/hello-world develop
    echo "Hello World" > hello.txt
    git add hello.txt
    git commit -m "Add hello.txt"
  4. push & PR 準備

    git push -u origin feature/hello-world
  5. develop ブランチにマージ

    • ローカルで git merge feature/hello-world を体験
    • コンフリクト解決の模擬演習(必要なら用意)
  6. git log / git status / git diff の確認

    • 作業履歴や差分を追えることを理解

Part 2: GitHub 上での実践フロー

Part 2 目的

  • チーム開発での GitHub フローを体験
  • Issue → feature ブランチ → PR → review → develop への merge という一連の流れを習得する

Part 2 ハンズオン

  1. Issue 作成

    • 簡単なタスクを Issue として登録
      • ex) hello.txt に自分の名前を追加して git-handson/yourname ディレクトリに保存してください -> Issue name: #1-add-name
  2. feature ブランチ作成

    • Issue 番号に対応するブランチを作る
    git checkout -b feature/#1-add-name develop
  3. 変更 & commit & push

    • hello.txt に名前を追加
    • git-handson/yourname ディレクトリへ保存
    • commit & push
  4. Pull Request 作成

    • develop ブランチ向けに PR を出す
    • PR テンプレートがあれば活用
  5. レビュー & 修正

    • レビュアーを指定し、レビューを依頼する
    • ペアでレビューを行い、修正があれば対応
  6. develop にマージ

    • CI が成功 & レビュー承認後に merge
    • feature/#1-add-name ブランチを削除
  7. main へのリリース模擬

    • developmain に PR を作り、マージ & タグ付け
    git tag v1.0.0
    git push origin v1.0.0

ハンズオン終了時の到達点

  • Git コマンドの基本操作を一通り理解している
  • GitHub 上で Issue → feature → PR → develop のループを体験できる
  • main と develop の違いを体感的に理解できる
  • CI/CD やブランチ保護の意味が腹落ちする

About

Hello Git!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published