マージコンフリクト - CI/CD 用語集の定義
マージコンフリクトは、両方のブランチが同じ行を変更した(または一方が他方の編集した箇所を削除した)ために、Git が 2 つのブランチを自動的に調和させられないときに発生します。Git はコンフリクトした領域を <<<<<<<、=======、>>>>>>> でマークするので、手動で解決します。
解決する
ファイルを望ましい最終状態に編集し、コンフリクトマーカーを削除してから git add して commit します。git status はまだコンフリクトしているファイルを一覧表示します。
回避する
頻繁に merge される短命なブランチは、長命なものよりコンフリクトが少なくなります。蓄積される乖離が少ないためです。
関連ガイド
Three-Way Merge - CI/CD Glossary DefinitionThree-Way Merge: A three-way merge reconciles two diverged branches by comparing both tips against their comm…
Short-Lived Branch - CI/CD Glossary DefinitionShort-Lived Branch: A short-lived branch is a feature branch that lives hours to a couple of days before merg…
What Is a Git Rebase?A git rebase replays your commits on top of another branch, producing a linear history instead of a merge com…