生成与补丁兼容的差异

有时你只需要使用补丁来应用差异。常规 git --diff 不起作用。试试这个:

git diff --no-prefix > some_file.patch

然后在其他地方你可以反转它:

patch -p0 < some_file.patch