Skip to content

Instantly share code, notes, and snippets.

@begroff
Last active June 12, 2018 18:00
Show Gist options
  • Save begroff/63e57c4b55448342c6548bd7135c1938 to your computer and use it in GitHub Desktop.
Save begroff/63e57c4b55448342c6548bd7135c1938 to your computer and use it in GitHub Desktop.
Git Config for Windows using Meld as diff/merge tool
[core]
autocrlf = false
editor = code --wait
[diff]
tool = meld
[difftool]
prompt = false
cmd = meld "$LOCAL" "$REMOTE"
[merge]
tool = meld
conflictstyle = diff3
[mergetool]
prompt = false
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
#cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
keepBackup = true
#! /bin/bash
/c/Program\ Files\ \(x86\)/Meld/Meld.exe $@
@begroff
Copy link
Author

begroff commented Jun 9, 2018

I am using Visual Studio Code and git bash as the integrated terminal. Created the meld bash script and put it in bin folder created in my home directory. Added bin folder to my path environment variable so that I could run 'meld' from git bash command line.

In Windows updated path variable in the UI:

  • Right click on This PC from Start Menu > Properties
  • Clicked Advanced System Settings > Environment Variables
  • Double click Path > clicked New
  • Entered %USERPROFILE%/bin

Inspired by the following resources:
https://blog.building-blocks.com/using-meld-as-a-git-merge-tool-on-windows/
https://stackoverflow.com/questions/34119866/setting-up-and-using-meld-as-your-git-difftool-and-mergetool

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