Git diff 在第 1 行到第 2 行区间内的文件提交之间的差异

问题描述 投票:0回答:1

正如我可以在 git Blame 上找到行间隔的结果

git blame -L 10,23 file.ext
.

我想在提交

gif diff
hash1
、文件
hash2
、第 10,23 行的间隔中执行
file.ext

类似

git diff hash1 hash2 -- file.ext (?) 10,23
.

git diff
1个回答
0
投票

试试这个:

git diff hash1 hash2 -U0 -L 10,23 -- file.ext

地点:

-U0
:将上下文行数设置为零,确保仅显示更改的行。

-L 10,23
:指定从 10 到 23 的行范围。

© www.soinside.com 2019 - 2024. All rights reserved.