2008年12月13日星期六

emacs 文件对比 合并

M-x ediff-buffers
M-x ediff-files
M-x ediff-windows-linewise

比对模式
?  帮助
n 跳到下一处不同
p 跳到上一处不同
4j 跳到第4处不同
a/b copy A/B's region to B/A
ra/rb 如果你觉得之前的修改有问题可以 restore 一下 A/B
! 重新刷新
## You might often want to skip the diffs that contain only differences in the number of white spaces. To do this, press ## (two hash marks). Emacs then simply skips these regions
v 向下翻页
V 向上翻页

有一个很强大的应用,是在使用svn时, 你修改了一个文件. 突然发现有点问题, 想与修改改的代码做一个本地的比对.
这个时候可以应用 ediff-files A文件对应 有问题的文件, B文件对应 A文件所在目录下./svn/text-base/[A文件名].svn-base
------------------------------------------------
ediff-buffers3 and ediff-files3 同时比对3文件
ca 拷贝c处的变更到A处
------------------------------------------------
Merging Files
M-x ediff-merge-buffers
M-x ediff-merge-files
用法跟 文件比较差不多,
+ 将两边差异合并
r 恢复
------------------------------------------------
多文件merge
M-x ediff-directories
M-x ediff-directories3
M-x ediff-merge-directories

会将所有文件的异同做个列表
M 回到列表上去

这个功能可以用在 公司和家里边的 configure 文件的同步上
------------------------------------------------
M-x eregistry This brings you to a buffer called *Ediff Registry* 查看当前所有的 Ediff
session

没有评论: