How to make git diff --ignore-space-change the default

前端 未结 6 1903

I could probably setup an alias, but it seems like I should be able to set this as an option in the config file, only I don\'t see anyway to do it.

I only want the <

6条回答
  •  难免孤独
    2020-12-04 21:14

    it would be great if this were possible with an option. but an alias works fairly well. here are the relevant lines from my .gitconfig:

    [diff]
        tool = mydiff
    [difftool "mydiff"]
        cmd = "colordiff -NuBbwi \"$LOCAL\" \"$REMOTE\" | less -R"
    [difftool]
        prompt = false
    [alias]
        dt = difftool
    

    this assumes using colordiff, which i recommend, giving you an almost exact copy of what git diff would show, with two differences:

    1. the --- line in colordiff is colored differently than the same line in git diff (very minor issue)
    2. each file is shown one at a time (annoying issue -- anyone know a fix?)

    here's my /etc/colordiffrc:

    plain=off
    newtext=green
    oldtext=red
    diffstuff=cyan
    cvsstuff=red
    

    Mac OS X 10.9.2, git version 1.8.5.2 (Apple Git-48)

    (colordiff was obtained from brew)

提交回复
热议问题