You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode Integration hell: why weeks of separate work break on merge day

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. 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.new rulemerge into mainevery dayMivayouRono

    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. 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.sharedrepositorymainpullyour laptop

    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. 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.Tuesdayyour linesRono's lines10 minyouRono

    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. 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.a monthof changesa dayof changes

    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. 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.Wednesdaymain10 mergesyouMivaRonoTest the whole appby hand, again?

    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.

  6. Quick check

    A team that merges less often.A team now mergesonce a week, notonce a day. Whathappens to theclashes they meet?

    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.

  7. Go further

    Where the habit comes from.every dayKent Beckmade continuous integrationa rule of ExtremeProgramming, in the 1990strunkan older name for main.Working with very shortbranches like these istrunk-based development

    Where the habit comes from.

Next episode Automated tests: how software checks itself after every change

Share this comic

More comics