# How to use Intellij as merge tool with jj

I’ve been experimenting with [jj](https://jj-vcs.github.io/jj/latest/) lately, and I was looking into how to set it up to use GoLand's merge tool for resolving conflicts. There are [docs](https://jj-vcs.github.io/jj/latest/config/#3-way-merge-tools-for-conflict-resolution) on configuring merge tools in general with jj, but nothing specific to Intellij IDEs.

Thankfully, I found [this documentation](https://www.jetbrains.com/help/idea/command-line-merge-tool.html#macos) on how to use IntelliJ's merge tool from the command line, and that was enough to figure out how to configure it to work with jj.

You just need to add the program and merge args to your jj `config.toml` file. Mine looks like this (configured to use GoLand, but this should work with any Intellij IDE):
```toml
[ui]
merge-editor = "goland" # corresponds to `merge-tools.goland` below

[merge-tools.goland]
program = "goland"
merge-args = ["merge", "$left", "$right", "$base", "$output"]
```
And that's it! If you don't have `goland` in your path, you may need to specify the full executable path as the `program`. In my case, it's `/Applications/GoLand.app/Contents/MacOS/goland`, but you'll have to verify where your IDE is installed.

Update: Turns out this information is already available on the [jj wiki](https://github.com/jj-vcs/jj/wiki/JetBrains-IDEs) on github. I just didn't find it in my initial searching.
