用vimdiff查看所有`git diffs` [英] Viewing all `git diffs` with vimdiff

查看:155
本文介绍了用vimdiff查看所有`git diffs`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Git Diff with Vimdiff 作为指南,它的工作方式与预期的一样,除非有许多文件有更改。



当有多个文件发生更改时,我运行 git diff ,它会打开第一个文件,退出后vimdiff的第一个实例,我收到以下消息:

 外部差异死亡,停在文件名

这是一种完全不同于我习惯的行为。在过去的SVN中我有类似的设置,并且在针对多个文件进行比较时,我会检查第一个文件,然后使用:wq 写入并退出,差异会打开。



Git并非如此。我尝试了:n [ext] ,但是这样做并不能将原始文件填充到左侧窗口中,以便可以根据修改后的版本进行分析。

b $ b

解决方案

  git config --global diff.tool vimdiff 
git config --global difftool.prompt false
git config --global alias.d difftool

输入 git d 会产生预期的行为,在vim中输入:wq 到变更集中的下一个文件。

I setup git diff to wrap into vimdiff, using "Git Diff with Vimdiff" as a guide, and it's working as expected unless there are many files with changes.

When there are multiple files with changes and I run git diff, it opens the first file and, after quitting the first instance of vimdiff, I'm presented with the following message:

external diff died, stopping at filename

This is a completely different behavior than I am used to. I had a similar setup in the past with SVN and, when diffing against multiple files, I would review the first file, then write and quit using :wq and the next file with differences would open up.

This is not the case with Git. I tried :n[ext], but doing so does not fill the left window with the original file so that it can be diffed against the modified version.

解决方案

git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool

Typing git d yields the expected behavior, typing :wq in vim cycles to the next file in the changeset.

这篇关于用vimdiff查看所有`git diffs`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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