在git add中显示更多的上下文 [英] showing more context in git add

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

问题描述

例如,使用git-diff时,我可以在显示diff时显示10条周围的上下文。

  git diff -U10 

我可以使用git-add --patch做类似的事吗?
理想情况下我想:

pre $ git add -p -U10

但我没有找到这样的选项。是否有这样的事情?

解决方案

您可以尝试:

  git -c diff.context = 10 add -p 

如果这可以工作,你可以通过使用以下命令来使它成为永久的:

  git config --global diff.context 10 

code>

这是我能找到的唯一可能的工作。


For example, with git-diff I can do the following to show 10 surrounding lines of context when showing the diff.

git diff -U10

Can I do something similar with git-add --patch? Ideally I would like to to:

git add -p -U10

But I didn't find such option. Is there anything like this?

解决方案

You can try:

git -c diff.context=10 add -p

If this works, you can make it permanent by using:

git config --global diff.context 10

This is the only thing I can find that might work.

这篇关于在git add中显示更多的上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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