How to get diff working like git-diff?

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

    Place this in your .bashrc or .zshrc :

    diff() { git diff --no-index "$1" "$2" | colordiff; }

    requirments : git and colordiff should be installed before-hand.

    usage : diff file1 file2

    example : for $diff .tmux.conf .zshrc.pre-oh-my-zsh

提交回复
热议问题