How can I do case insensitive git diffing while also doing `git diff --color`?

后端 未结 2 1078
傲寒
傲寒 2021-01-11 09:26

Is it possible to do a case insensitive git diff while also doing git diff --color-words? Or do I need to use an external diff program while doing

相关标签:
2条回答
  • 2021-01-11 10:03

    I figured out a way to perform case-insensitive diff, although not with the --color-word option as the OP asked for. See my answer to my own question.

    0 讨论(0)
  • 2021-01-11 10:05
    GIT_EXTERNAL_DIFF='diff -ipu "$2" "$5" #' git diff --ext-diff
    

    Or, in a nicer fashion without the # hack I used there:

    echo 'diff -ipu "$2" "$5"' >myscript; chmod a+x myscript;
    GIT_EXTERNAL_DIFF='./myscript' git diff --ext-diff
    

    I agree it would be nicest if git-diff would just have an -i option...

    0 讨论(0)
提交回复
热议问题