Skip to content

Instantly share code, notes, and snippets.

@johnnyasantoss
Last active May 13, 2024 16:58
Show Gist options
  • Save johnnyasantoss/f0a99283a6ef428365e0cd5eab7ae99d to your computer and use it in GitHub Desktop.
Save johnnyasantoss/f0a99283a6ef428365e0cd5eab7ae99d to your computer and use it in GitHub Desktop.
JetBrains Rider as Default Merge and Diff tool
# Diff with JetBrains Rider
[diff]
tool = rider
[difftool]
prompt = false
[difftool "rider"]
cmd = D:\\\\Program\\ Files\\\\Jetbrains\\\\apps\\\\Rider\\\\ch-0\\\\181.4379.788\\\\bin\\\\rider64.exe diff "$LOCAL" "$REMOTE"
# Merge with JetBrains Rider
[merge]
tool = rider
[mergetool]
prompt = false
[mergetool "rider"]
cmd = D:\\\\Program\\ Files\\\\Jetbrains\\\\apps\\\\Rider\\\\ch-0\\\\181.4379.788\\\\bin\\\\rider64.exe merge $LOCAL $REMOTE $BASE $MERGED
trustExitCode = true
@nzbart
Copy link

nzbart commented Mar 27, 2020

Thanks for providing a base for me to work from. I ended up going with this config setting, which detects the location of the Jetbrains Toolbox rider64.exe and waits for the difftool to exit. Run the following PowerShell commands:

git config --global difftool.rider.cmd '\"C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe\" -NoProfile -Command \"start -Wait (ls -r ~/AppData/Local/JetBrains/Toolbox/apps/Rider -fi rider64.exe | sort | select -last 1 -expand FullName) -ArgumentList ''diff'', ''\\\"$LOCAL\\\"'', ''\\\"$REMOTE\\\"''\"'
git config --global mergetool.rider.cmd '\"C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe\" -NoProfile -Command \"start -Wait (ls -r ~/AppData/Local/JetBrains/Toolbox/apps/Rider -fi rider64.exe | sort | select -last 1 -expand FullName) -ArgumentList ''merge'', ''\\\"$LOCAL\\\"'', ''\\\"$REMOTE\\\"'', ''\\\"$BASE\\\"'', ''\\\"$MERGED\\\"''\"'

@kirano99
Copy link

Thanks for this! Super helpful! 👍

@adiletelf
Copy link

Amazing!

@conanthedev
Copy link

Thanks super useful! The JetBrains Toolbox can now generate shell scripts and register a PATH that points to the latest executables. You can read the details here: https://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#toolbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment