问题描述
方案:我有一个补丁文件,该补丁文件可以干净地应用于我的工作文件,但我不希望该补丁程序有所有更改。
Scenario: I have a patch file that applies cleanly to my working files, but I do not want all the changes from the patch.
通常,我做 vim example.patch
,删除不需要的更改,然后应用 patch -p0 -i example.patch
,但有时补丁无法完全应用,我必须重新开始。
Usually, I do vim example.patch
, remove unwanted changes and them apply patch -p0 -i example.patch
but at times the patch does not apply cleanly, and I have to start over again.
是否有一个补丁文件编辑器,允许用户编辑和删除补丁的一部分,并且仍然可以干净地应用?
推荐答案
如果您在emacs中打开一个diff文件并将编辑器置于 diff模式,则可以实际编辑补丁,它将以一种聪明的方式更新块标记。对我来说真的很好!
If you open a diff file in emacs and put the editor in "diff" mode you can actually edit patches and it will update the hunk markers in a smart way. Works really well for me!
这篇关于如何干净地编辑差异/补丁文件?有补丁文件编辑器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!