有时您只需要使用diff即可应用补丁。常规git --diff不起作用。尝试以下方法:
git diff --no-prefix > some_file.patch
然后在其他地方可以将其反转:
patch -p0 < some_file.patch