加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

版本控制 – 针对源代码控制存储库的vimdiff

发布时间:2020-12-15 22:28:33 所属栏目:安全 来源:网络整理
导读:scmdiff标记了文件的签入版本与正在编辑的文件之间的差异.它通过着色改变的线条来标记它.有没有办法使用vimdiff样式拆分查看更改而不是仅仅更改更改的行? 例如,如果abc是版本控制下的文件,那么我可以使用以下内容在一侧显示abc的当前版本,在另一端显示最新
scmdiff标记了文件的签入版本与正在编辑的文件之间的差异.它通过着色改变的线条来标记它.有没有办法使用vimdiff样式拆分查看更改而不是仅仅更改更改的行?

例如,如果abc是版本控制下的文件,那么我可以使用以下内容在一侧显示abc的当前版本,在另一端显示最新版本:

tkdiff abc

我也可以这样做:

tkdiff -r1 -r5 abc

显示版本1和5之间的差异.最后,我可以这样做:

tkdiff -r1 abc

查看当前版本和版本1之间的区别.

这是我想在文件的两个版本之间看到的差异,只使用Vim.可以吗?我在Linux下工作,我使用Bitkeeper进行版本控制.

解决方法

我使用 vcscommand插件与VCS进行交互.

从描述:

VIM 7 plugin useful for manipulating files controlled by CVS,SVN,SVK and git within VIM,including committing changes and performing diffs using the vimdiff system.

特别是:VCSVimDiff将拆分当前窗口,并在repo中显示最新版本的“vimdiff”.您还可以指定一个修订版号来比较当前缓冲区(即:VCSVimDiff -2),或两个修订版号以相互区分.以下是文档中的相关部分:

:VCSVimDiff

Uses vimdiff to display differences between versions of the current
file.

If no revision is specified,the most recent version of the file on
the current branch is used. With one argument,that argument is used
as the revision as above. With two arguments,the differences between
the two revisions is displayed using vimdiff.

With either zero or one argument,the original buffer is used to perform
the vimdiff. When the scratch buffer is closed,the original buffer
will be returned to normal mode.

Once vimdiff mode is started using the above methods,additional vimdiff
buffers may be added by passing a single version argument to the
command. There may be up to 4 vimdiff buffers total.

Using the 2-argument form of the command resets the vimdiff to only those 2 versions. Additionally,invoking the command on a different file will close the previous vimdiff buffers.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读