One data grid for JavaScript, React, Vue & Angular. Sorting, filtering, virtualization, pinning, and CSV export included. Early access $199 $349 → [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, 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.
How to capitalize the first letter in JavaScript?
How to capitalize the first letter in JavaScript?

How to concatenate a strings in JavaScript?
How to concatenate a strings in JavaScript?

How to sleep in Javascript
How to sleep in Javascript

How to migrate CoreUI React Templates to Vite
How to migrate CoreUI React Templates to Vite

Answers by CoreUI Core Team