简体   繁体   English

在 git diff 输出中更改前后的行数

[英]change no of lines after and before in git diff output

I want to increase the number of lines displayed before and after changes in git diff output.我想增加git diff输出更改前后显示的行数。

Analogous to grep -A3 -B5 ...类似于grep -A3 -B5 ...

According to git diff --help , git diff supports the same arguments as the standard diff command w/r/t context:根据git diff --helpgit diff支持与 w/r/t 上下文的标准diff命令相同的参数:

   -U<n>, --unified=<n>
       Generate diffs with <n> lines of context instead of the usual three. Implies
       -p.

您可以使用-U开关来控制差异周围的上下文行数:

$ git diff -U5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM