How to get diff working like git-diff?

前端 未结 14 2264
慢半拍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:11

    If you don't have colordiff or git diff, you can get color by vim.

    cdiff() { diff -u $@ | vim -R -; }
    

    or simply

    cdiff() { diff -u $@ | view -; }
    

提交回复
热议问题