How to make “git diff” output normal diff format (non-unified, non-context)?

倖福魔咒の 提交于 2019-11-30 06:46:18
Rob Bednark
git difftool --extcmd=diff

or, without prompting:

git difftool --extcmd=diff --no-prompt

This is git difftool rather than git diff but it is doing what I want.

You can use same script (see man git(1) for details):

$ cat diff.sh
#!/bin/sh
# get args: path old-file old-hex old-mode new-file new-hex new-mode

diff "$2" "$5"

return=$?
if [ $return -le 1 ]; then
    exit 0
else
    exit $return
fi

$ GIT_EXTERNAL_DIFF=./diff.sh git diff HEAD^..HEAD
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!