StoicBuilder

HandbookIX the CuriaMerge conflicts

IXthe Curia, Work as a team

Merge conflicts

1 min readUpdated 28 November

In plain words

A merge conflict happens when two branches change the same lines of a file in different ways, so git stops and marks both versions for a person to combine.

Where you see it

You merge main into your branch and git prints CONFLICT (content): Merge conflict in lib/billing/plans.ts. Inside the file, between the <<<<<<< and >>>>>>> markers, sit your version and your teammate's: you added an annual price, they renamed Starter to Basic.

lib/billing/plans.tsserver
<<<<<<< HEAD starter: { name: "Starter", monthly: 1000, annual: 10000 },======= starter: { name: "Basic", monthly: 1000 },>>>>>>> main
Your branch added the annual price; main renamed the plan. The right answer keeps both: the name Basic, with an annual price.

What goes wrong

  1. Picking one side to make it go away

    Accept Current Change or Accept Incoming Change throws the other person's work away entirely. Read both sides, work out what each was for, and write the line that does both.

  2. Letting the agent resolve it blind

    An agent that sees only the markers will guess. Give it the intent of both changes, or the two commits, and ask it to explain each choice before saving.

  3. Committing leftover markers

    A stray <<<<<<< line breaks the build, or worse, lands inside a string or comment where nothing complains. Run git diff --check, which flags leftover markers, before you commit.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Resolve the merge conflicts on this branch by keeping the intent of both sides, not by picking one. For each conflict, tell me what each side changed and what you kept, then run git diff --check and the tests before committing the merge.

Quick check

Sign in to earn +10 XP for it

Your branch adds an annual price to Harbor's Starter plan; main renamed Starter to Basic. The lines conflict. What's the right resolution?

Got a prompt that touches merge conflicts?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.