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.
<<<<<<< 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
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.
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:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesgit config --global --get merge.conflictStylechecks the global value.git config --local --get merge.conflictStylechecks the current repository’s value.
For details on the setting and Git configuration, see the merge configuration manual and git-config manual.
Quick Recap
Best Value
- Used Book in Good Condition
Rank #3
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.




