Git:使用git add -i或git add -e时显示更多上下文? [英] Git: show more context when using git add -i or git add -e?

查看:772
本文介绍了Git:使用git add -i或git add -e时显示更多上下文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有选择性地提交一个大文件的一部分,我希望看到每个大块的更多上下文。这是可能的吗?

解决方案

简短的回答:不。 code> git diff 具有 -U < / code>选项,它允许您自定义围绕更改显示的行数。例如, git diff -U5 ... 将显示5行上下文。据我所知,在交互模式下,差异显示没有这样的选项。


I'm selectively committing parts of a large file and I'd like to see more context around each hunk. Is this possible?

解决方案

Short answer: no.

git diff has the -U<n> option which allows you to customize the number of lines to show around a change. For example, git diff -U5 ... will show 5 lines of context. As far as I can tell, there is no such option available for the diff display in the interactive mode.

这篇关于Git:使用git add -i或git add -e时显示更多上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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