Understanding merge conflicts and how they occur
You and your team colleague are both updating a one-page portfolio website. You’re working on the About Me section, while your colleague is adding new fonts and styles to the entire page. This is where merge conflicts come into play:
Figure 6.1 – Merge conflicts
What is a merge conflict?
Think of a merge conflict like two people trying to paint different pictures on the same canvas at the same time. You both have your ideas, but they clash in the same space:
Figure 6.2 – What is a merge conflict?
How does a merge conflict happen?
Both you and your colleague pull the latest version of the website from the main
branch to start your work. You add a detailed biography and some images to the About Me section, and your colleague changes the font style and color scheme of the entire page, including the About Me section. Figure 6.3 demonstrates this clash...