如何获得像git-diff一样的diff工作? [英] How to get diff working like git-diff?

查看:132
本文介绍了如何获得像git-diff一样的diff工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢 git diff 的输出格式。线条间变化的颜色和 + / - 表示比GNU diff更容易阅读。



我可以运行 git diff 使用 - no-index 外部标志的git回购,它工作正常。但是,它似乎缺少用于从递归 diff 排除文件或子目录的 - exclude 选项。

有两种方法可以获得两全其美? (颜色选项和 + / - 格式 - 排除GNU diff的选项)。



我已经尝试使用 colordiff ,但我仍然更喜欢输出格式 git diff

解决方案

我不知道如何做颜色,但是这会做 +/- 而不是< >

  diff -u file1 file2 


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

I can run git diff using --no-index flag outside of a git repo and it works fine. However, it appears to be missing the --exclude option for excluding files or subdirectories from a recursive diff.

Is there a way to get the best of both worlds? (color options and +/- format of git diff and --exclude option of GNU diff).

I've experimented with colordiff, but I still prefer the output format of git diff

解决方案

I don't know how to do color but this will do the +/- rather than < and >.

diff -u file1 file2

这篇关于如何获得像git-diff一样的diff工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆