Skip to content

Instantly share code, notes, and snippets.

@johnnyasantoss
Last active April 11, 2024 12:54
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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!

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