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.



