diff git_git diff长行

diff git

I find git diff output is not easy to read when the text file contains long lines that is long enough to exceeds the screen size.

我发现当文本文件包含的行足够长以超过屏幕尺寸时, git diff输出不容易阅读。

We may not forbid the using the long lines for all files.

我们可能不禁止对所有文件使用长行。

How to handle lone lines in git diff better?

如何更好地处理git diff孤立行?

Two possible methods to make git diff with long lines easier to read:

使长行git diff易于阅读的两种可能方法:

Method 1: Git can highlight changes in lines instead of showing two lines of each version:

方法1:Git可以突出显示行中的更改,而不是显示每个版本的两行:

git diff --word-diff

It will prints changes in format like:

它将以以下格式打印更改:

[-deleted word-]{+added_word+}

Method 2: Make git wrap long lines:

方法2:使git换行长行:

PAGER='' git diff --word-diff
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/git-diff-with-long-lines/

diff git

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值