Ideas and thoughts on programming and software development

Semantic merge as the default merge tool with git on Windows

When working on a version control system like git, mercurial or plasticscm, branching and merging are part of our daily work. The merge operation may cause conflicts, and usually we must manually solve them using 3-way merge tools.

By default git won’t provide a tool for this operation, so in this article we will see how to configure an external tool (in our case our Semantic Merge tool: semanticmerge.exe) on git in the Windows platform.

Setting git configuration

One of the most common ways of setting the configuration is by using the git config command, for example:

git config --global core.editor emacs

Will set the default text editor. We have the –global modifier, that saves the configuration at user level, we will talk about the levels in the next section. This operation saves the following data in our configuration file:

[core]
editor = emacs

Git stores the configuration in a .config file at three different levels: