vim -d 1.txt 2.txt打开编辑器查看两个文本的不同 git diff a.txt b.txt >patch.txt 将文本的不同输出到patch.txt patch 1.txt <patch.txt 补丁到1.txt