バージョン管理(Git)は、CI/CDが構築される基盤です——リポジトリ内のコード変更がパイプラインを トリガー し、ブランチ戦略がCI/CDの実行方法を形作ります。GitとCI/CDの統合こそが、自動化された変更駆動のデリバリーを可能にします。
GitがCI/CDをトリガーする
CI/CD pipelines are TRIGGERED by Git events:
→ a PUSH to a branch → runs CI (build + test) on that change
→ a PULL REQUEST → runs CI to verify the change before merging
→ a MERGE to main → may trigger deployment (CD)
→ a TAG (e.g. v1.2.0) → may trigger a release/production deployment
→ Every code change in Git automatically drives the pipeline → change-driven automation.
ブランチとCI/CD
→ FEATURE BRANCHES → CI runs on each (build/test the branch); PRs must pass CI to merge
→ MAIN branch → kept always working (green); merges trigger deployment to staging/prod
→ Different branches can map to different ENVIRONMENTS or pipeline behaviors
(e.g. main → production; develop → staging)
→ BRANCH PROTECTION → require CI to pass + reviews before merging (quality gate)
