我希望在git diff
输出中更改前后显示的行数不增加。
类似于grep -A3 -B5 ...
答案 0 :(得分:6)
根据git diff --help
,git diff
支持与标准diff
命令w / r / t上下文相同的参数:
-U<n>, --unified=<n>
Generate diffs with <n> lines of context instead of the usual three. Implies
-p.
答案 1 :(得分:3)
您可以使用/categories/cat1_cat2
开关来控制diff周围的上下文行数:
-U