Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober 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 Scan×
Skip to content
World desk2 min

How to Configure Git to Use diff3-Style Conflict Markers

Use Git’s merge.conflictStyle setting to show the common-ancestor version in conflict markers, globally or just in one repository.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make Git show the common-ancestor version in merge conflicts, run git config --global merge.conflictStyle diff3. To apply the setting only to the repository you are currently in, omit --global.

Enable diff3 conflict markers

Run the command that matches the scope you want:

  • For your user account across repositories: git config --global merge.conflictStyle diff3
  • For the current repository only: From inside that repository, run git config merge.conflictStyle diff3.

Git documents merge.conflictStyle as the setting for the style used to write conflicted hunks into working-tree files during a merge. The global form is also shown in the Git book’s Advanced Merging chapter.

As an Amazon Associate I earn from qualifying purchases.

What diff3 adds to a conflict

The usual merge style shows the conflicting text from the current side and the other side, separated by =======. The diff3 style also shows the original common-ancestor text, marked by |||||||. That base version can help you see how each side differs from the text they both started with.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<<<<<<< ours
version from the current side
||||||| base
original common-ancestor version
=======
version from the other side
>>>>>>> theirs

Here, ours, base, and theirs are illustrative labels; Git’s actual labels can vary with the merge operation. The markers provide context for resolving the textual conflict, but they do not resolve it automatically.

#1 Best Overall
Sale
Pearson Computer Networking, 8E
  • brand: Pearson
  • Computer Networking, 8e

Choose between merge, diff3, and zdiff3

Git’s configuration documentation describes merge as the default and lists diff3 and zdiff3 as alternatives. The choice is mainly about how much base context appears in a conflict and how much text the conflict region includes.

Style What the conflict shows Conflict-region effect
merge Both sides’ conflicting text; omits the common-ancestor text. Tends to produce smaller conflict regions.
diff3 Both sides’ text plus the common-ancestor version. Adds base context to the conflict region.
zdiff3 Base context, like diff3. Trims matching lines on either side near the beginning or end of a conflict region.

The style definitions and zdiff3 behavior are documented in the Git merge configuration manual and the Git 2.51.1 configuration manual.

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

Check which scope is setting the value

If Git does not use the style you expected, an existing configuration at another scope may affect the value. Global configuration applies as the user-level default across repositories; the command without --global sets a repository-level value when run inside a repository. Check the relevant settings with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • git config --global --get merge.conflictStyle checks the global value.
  • git config --local --get merge.conflictStyle checks the current repository’s value.

For details on the setting and Git configuration, see the merge configuration manual and git-config manual.

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.

Leave a Reply

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

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.