@echo off
REM ---- Install? ----REM To install, run gitvdiff --install
if %1==--install goto install
REM ---- Find DiffMerge ----
if DEFINED ProgramFiles^(x86^) (Set DIFF="%ProgramFiles(x86)%\SourceGear\DiffMerge\DiffMerge.exe") else (Set DIFF="%ProgramFiles%\SourceGear\DiffMerge\DiffMerge.exe")
REM ---- Switch forward slashes to back slashes ----
set oldW=%2set oldW=%oldW:/=\%set newW=%5set newW=%newW:/=\%
REM ---- Launch DiffMerge ----
%DIFF% /title1="Old Version" %oldW% /title2="New Version" %newW%
goto :EOF
REM ---- Install ----:installset selfL=%~dpnx0set selfL=%selfL:\=/%@echo ongit config --global diff.external %selfL%@echo off
:EOF
$ cat tkgitdiff#!/bin/sh
## tkdiff for git.# Gives you the diff between HEAD and the current state of your file.#
newfile=$1git diff HEAD -- $newfile > /tmp/patch.datcp $newfile /tmpsavedPWD=$PWDcd /tmppatch -R $newfile < patch.datcd $savedPWDtkdiff /tmp/$newfile $newfile
'git mergetool' will now attempt to use one of the following tools:meld opendiff kdiff3 tkdiff xxdiff tortoisemerge gvimdiff diffusediffmerge ecmerge p4merge araxis bc3 codecompare emerge vimdiffMerging:www/css/style.csswww/js/controllers.js
Normal merge conflict for 'www/css/style.css':{local}: modified file{remote}: modified fileHit return to start merge resolution tool (meld):