Skip to content

Instantly share code, notes, and snippets.

@kasimte
Forked from YanhaoYang/.gitconfig-for-diffmerge
Created October 29, 2020 05:18
Show Gist options
  • Select an option

  • Save kasimte/9af67b28638c975678bef36db495944a to your computer and use it in GitHub Desktop.

Select an option

Save kasimte/9af67b28638c975678bef36db495944a to your computer and use it in GitHub Desktop.

Revisions

  1. @YanhaoYang YanhaoYang renamed this gist Jan 7, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @YanhaoYang YanhaoYang revised this gist Jan 7, 2013. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions usr-bin-diffmerge
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/bin/sh
    ## A little script to make it easier to launch DiffMerge from the command line.
    ## Install this script into a folder in your path, such as /usr/bin or /usr/local/bin.
    ##
    ## Version 3.3.0.1001
    ## Copyright (C) 2003-2009 SourceGear LLC. All Rights Reserved.
    ##############################################################################

    ## Change DIFFMERGE_PATH to point to where you installed DiffMerge

    DIFFMERGE_PATH=/Volumes/App/Applications/DiffMerge.app

    ## The actual executable is hidden inside the .app bundle.

    DIFFMERGE_EXE=${DIFFMERGE_PATH}/Contents/MacOS/DiffMerge

    ## Launch DiffMerge using the given command line arguments. Use --help for
    ## additional information or see the man page distributed along with this
    ## shell script.

    exec ${DIFFMERGE_EXE} --nosplash "$@"
  3. @YanhaoYang YanhaoYang created this gist Jan 7, 2013.
    9 changes: 9 additions & 0 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    [diff]
    tool = diffmerge
    [difftool "diffmerge"]
    cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
    [merge]
    tool = diffmerge
    [mergetool "diffmerge"]
    cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
    trustExitCode = true
    5 changes: 5 additions & 0 deletions git-config.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    git config --global diff.tool diffmerge
    git config --global difftool.diffmerge.cmd 'diffmerge "$LOCAL" "$REMOTE"'
    git config --global merge.tool diffmerge
    git config --global mergetool.diffmerge.cmd 'diffmerge --merge --result="$MERGED" "$LOCAL" "$(if test -f "$BASE"; then echo "$BASE"; else echo "$LOCAL"; fi)" "$REMOTE"'
    git config --global mergetool.diffmerge.trustExitCode true