How CI/CD works: why releasing code every day is safer than once a month
Continuous integration: why merging every day hurts less than once a month
Many software teams merge their work into the main branch every day, some of them many times a day, on purpose. Why would anyone merge more often, when merging was the part that hurt? Continuous integration, explained.
-
1
For the next month, Miva, who leads the team, sets a new rule: each of you merges your work into main at least once a day, even when your part is not finished yet. The habit has a name: continuous integration.
-
2
From now on, a branch lives a few hours, a day at most. The team's code sits in a shared repository, Git's store of the code on a server, and before you merge, you pull from it: Git brings the newest main onto your laptop.
-
3
On Tuesday, your change clashes with one that Rono merged this morning. It touches only a few lines, which you both wrote this week, so you find the problem together and fix it in ten minutes.
-
4
Clashes still happen, but now each one is small. You find it the same day. Its cause can only be in a few hours of work, and everyone still remembers what they did.
-
5
There is a new problem, though. Main now changes ten times a day, and nobody can test the whole app by hand ten times a day.
-
Quick check
A team that merges less often.
Show the answer
Each clash now holds a week of changes, so it is bigger and its cause is harder to find. They also find it later, when people have forgotten what they changed.
-
Go further
Where the habit comes from.