October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Read diff3 Conflict Markers and Choose the Right Changes

Diff3 adds the common-base text to a Git conflict. Compare both sides against it, choose the intended result, remove the markers, and validate the file.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A diff3 conflict shows the two competing versions of a disputed section plus the common-base text they both started from. Compare each side with that base, decide which behavior the file should have, then remove the marker lines and validate the result.

What each diff3 marker means

A typical Git conflict in diff3 style looks like this:

As an Amazon Associate I earn from qualifying purchases.

<<<<<<< ours
current-side text
||||||| base
text from the common ancestor
=======
other-side text
>>>>>>> theirs
  • <<<<<<< starts the current-side section. Its label may vary with the operation or context.
  • ||||||| begins the base section: the shared earlier text before the two versions diverged.
  • ======= separates the base from the other side’s version.
  • >>>>>>> ends the conflict and usually labels the other side.

In Git’s example, the base appears between the current side and the other side. The key is to compare each proposed version with the base, rather than treating the marker labels as instructions about which version is correct. See Pro Git’s Advanced Merging guide and the Git merge documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to decide what the resolved file should contain

  1. Read the surrounding file. Establish what the disputed text is for before choosing between edits.
  2. Use the base as a reference point. It shows what existed before either side’s change; it is evidence of history, not automatically the right answer.
  3. Compare the current side with the base. Identify what changed and what effect that change is meant to have.
  4. Compare the other side with the base. Assess its intent and effect in the same way.
  5. Choose a resolution based on intended behavior. Keep one side if that is the intended change, combine edits if they can coexist, or write a new version that preserves what the file needs to do. Copying both sides unchanged is unsafe when they conflict.
  6. Remove the annotations and rejected alternatives. The saved file should contain the resolved content, not the conflict markers.
  7. Check the result in context and validate it. Run the project’s relevant checks before completing the merge or rebase.

This reflects the three-way model described in the GNU diff3 merging manual: two changed versions are considered against a common preceding version. The markers expose the competing text; they do not determine which resolution is correct.

Show the base with diff3, or use zdiff3

Git’s merge.conflictstyle setting controls how conflict regions are presented. The styles differ in whether the base is shown and how much unchanged context remains inside the region:

Style Base visible? Context in the conflict region
merge No Does not show the common-base text.
diff3 Yes Shows the base text between the two sides.
zdiff3 Yes Shows the base while trimming common lines from the conflict region.

The Linux Kernel’s backporting documentation lists merge, diff3, and zdiff3 as conflict styles and recommends diff3 for making a patch’s before-and-after changes clearer. Git 2.35 introduced zdiff3; it is a more compact presentation, not a different rule for resolving conflicts.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Set or display diff3 conflict style

To make diff3 the default for your Git configuration, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
git config merge.conflictstyle diff3

To set the preference globally for your user account, run:

git config --global merge.conflictstyle diff3

Pro Git also documents re-checking out a conflicted file in diff3 style:

git checkout --conflict=diff3 <path>

Check the command syntax against the Git version and workflow you use, particularly if your team standardizes how conflicts are shown during merge or rebase.

Rank #4
The SQL Programming Language: .
  • Used Book in Good Condition

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.