View Light

HOWTO: Set Visual Studio Code as the default Mercurial Merge Tool

As of VSCode 1.69, it has an excellent three-pane merge tool on par with the GitKraken and Beyond Compare merge tools. Here's how to configure Hg to use it (In Linux anyway, for other OS's you will have to keep searching...)

I'm pretty new to Mercurial, being totally used to Git and GitKraken, so I've been a little lost with handling merges as most Linux-based merge tools make no sense to me as far as understanding how to work with their UI. (kdiff, meld, vimdiff all are off on another planet as far as what I'm used to.)

So happily I found this article (Using VS Code for merges in Mercurial) explaining just how to do that.

It has additional info that you will find useful, but I wanted to capture the basics just in case the article goes away.

Base changes needed in your ~/.hgrc file:

[extensions]
extdiff = 

[ui]
merge = code 

[merge-tools]
code.priority = 100
code.premerge = True
code.args = --wait --merge $other $local $base $output 

[extdiff]
cmd.vsd = code
opts.vsd = --wait --diff
Rating: (You must be logged in to vote)
Reply
Replies:
12/5/2022 3:37:50 PM
0 Dislikes: 0