Ship internal tools in hours, not weeks. Real auth, users, jobs, audit logs, and cohesive UI included. Early access $249 $499 → [Get it now]

How to configure Git merge tool

Setting up a visual merge tool makes resolving Git conflicts significantly easier by providing a clear three-way comparison interface. As the creator of CoreUI with over 25 years of development experience, I’ve resolved countless merge conflicts across numerous projects. The most effective solution is to configure Git to use your preferred visual merge tool using git config merge.tool. This setup streamlines conflict resolution and reduces errors during merges.

Configure your preferred merge tool using git config merge.tool.

# Set VS Code as merge tool
git config --global merge.tool vscode
git config --global mergetool.vscode.cmd 'code --wait --merge $REMOTE $LOCAL $BASE $MERGED'

# Set Meld as merge tool
git config --global merge.tool meld

# Set Kdiff3 as merge tool
git config --global merge.tool kdiff3

# Use the merge tool
git mergetool

The git config --global merge.tool command sets your preferred tool globally. For VS Code, an additional command configures how Git launches it with the proper flags and file arguments. Popular tools like Meld and Kdiff3 work with minimal configuration. When you encounter merge conflicts, running git mergetool automatically opens the configured tool, showing the base version, local changes, remote changes, and merged result for easy visual comparison and resolution.

Best Practice Note

This is the same merge tool setup we recommend for CoreUI contributors to ensure smooth collaboration. After resolving conflicts with the merge tool, Git creates .orig backup files that you can safely delete or ignore by adding *.orig to your .gitignore. Different teams may prefer different tools, so choose one that your entire team is comfortable with.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author

Subscribe to our newsletter
Get early information about new products, product updates and blog posts.
What are the three dots `...` in JavaScript do?
What are the three dots `...` in JavaScript do?

How to Use Bootstrap Dropdown in Angular – CoreUI Integration Guide
How to Use Bootstrap Dropdown in Angular – CoreUI Integration Guide

How to Add a Tab in HTML
How to Add a Tab in HTML

How to Open All Links in New Tab Using JavaScript
How to Open All Links in New Tab Using JavaScript

Answers by CoreUI Core Team