سؤال

I'm trying to get Git to work with DiffMerge, and I've never used either of them before this week. For what its worth, all of this is for Ruby on Rails.

I followed the instructions at http://jdonley83.com/blog/setting-up-git-in-windows-with-diffmerge/ pretty much to the letter. However, when I enter "Git Diff", instead of loading DiffMerge, the Command Line just crashes.

So you don't have to go rereading the instructions at the website, the site basically says to setup two files called diffmerge-diff.sh and diffmerge-diff.sh written as follows:

diffmerge-diff.sh

#!/bin/sh

path="$1"
old="$2"
new="$5"

"C:/Program Files (x86)/SourceGear/DiffMerge/DiffMerge.exe" "$old" "$new" --title1="Old" --title2="New $path"

and diffmerge-merge.sh:

#!/bin/sh

localPath="$2"
basePath="$1"
remotePath="$3"
resultPath="$4"

if [ ! -f $basePath ]
then
    basePath="c:/Users/Joseph/diffmerge-empty"
fi

"C:/Program Files (x86)/SourceGear/DiffMerge/DiffMerge.exe" --merge --result="$resultPath" "$localPath" "$basePath" "$remotePath" --title1="Mine" --title2="Merged: $4" --title3="Theirs"

And...meanwhile...my .gitconfig includes these:

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    cmd = "c:/Users/Me/GitConfigFiles/diffmerge-merge.sh" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
    trustExitCode = false
    keepBackup = false
[diff]
    tool = diffmerge
    external = c:/Users/Me/GitConfigFiles/diffmerge-diff.sh

The website also said: "You may need to modify the paths in these two files, depending on where you installed DiffMerge on your system." but I didn't know what they meant.

I know this might be a lot of info to digest, but does anyone know what the problem could be? If its unresolvable, is there as simpler way to do this? Is maybe Diffmerge too complicated for entry-level Git?

Thank you for your support.

هل كانت مفيدة؟

المحلول

What does “the Command Line just crashes” mean? I’ve never seen a command line crash.

You don’t need any difftool for using git. git diff is perfectly fine. You need a good tool for 3-way merges, but that’s a different topic.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top