首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >跳到git diff中的下一个修改文件?

跳到git diff中的下一个修改文件?
EN

Stack Overflow用户
提问于 2012-11-20 07:57:00
回答 3查看 15.9K关注 0票数 53

我犯了一个错误,将一个Visual Studio项目从2008升级到2010,而没有事先检查我之前的更改。正因为如此,我有一个巨大的系统生成的文件(10k+行),它每隔4行就会更改一次。

我通常很擅长经常签入东西,所以我通常只会使用向下键来滚动我的更改。在这种情况下,滚动浏览对系统生成的文件所做的更改需要几个生命周期。

有没有一种方法可以在你完成git diff之后跳到下一个修改过的文件,这样你就不必滚动浏览每个文件上的每个更改?

EN

回答 3

Stack Overflow用户

发布于 2015-08-14 02:20:33

对于其他有用的命令,请键入h以获取帮助(当处于git diff中时,该命令位于less中)。

特别是:

代码语言:javascript
复制
                           JUMPING

  g  <  ESC-<       *  Go to first line in file (or line N).
  G  >  ESC->       *  Go to last line in file (or line N).
  p  %              *  Go to beginning of file (or N percent into file).
  t                 *  Go to the (N-th) next tag.
  T                 *  Go to the (N-th) previous tag.
  {  (  [           *  Find close bracket } ) ].
  }  )  ]           *  Find open bracket { ( [.
  ESC-^F <c1> <c2>  *  Find close bracket <c2>.
  ESC-^B <c1> <c2>  *  Find open bracket <c1>
票数 7
EN

Stack Overflow用户

发布于 2012-11-20 08:14:08

另一种选择是调用update-index命令,并告诉它假装一个巨大的文件没有更改。这里有一个更完整的here示例。

票数 0
EN

Stack Overflow用户

发布于 2021-12-16 17:03:30

我认为你想要:

代码语言:javascript
复制
:n                *  Examine the (N-th) next file from the command line.

less帮助中可以看到这一点。

代码语言:javascript
复制
                      CHANGING FILES
:e [file]            Examine a new file.
^X^V                 Same as :e.
:n                *  Examine the (N-th) next file from the command line.
:p                *  Examine the (N-th) previous file from the command line.
:x                *  Examine the first (or N-th) file from the command line.
:d                   Delete the current file from the command line list.
=  ^G  :f            Print current file name.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13464540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档