How to get diff working like git-diff?

前端 未结 14 2247
慢半拍i
慢半拍i 2020-12-12 10:42

I like the output formatting of git diff. The color and the +/- representation of changes between lines is easier to read than GNU di

14条回答
  •  再見小時候
    2020-12-12 11:07

    1. Install colordiff.

    2. Update your ~/.colordiffrc (copying /etc/colordiffrc first, if necessary):

      # be more git-like:
      plain=off
      newtext=darkgreen
      oldtext=darkred
      diffstuff=darkcyan
      
    3. Use colordiff -u file1 file2 for two files or colordiff -ruN path1 path2 for recursively comparing paths.

    It's not exactly the same, but it's very close.

提交回复
热议问题