Git Git Diff Produce a patch-compatible diff


Example

Sometimes you just need a diff to apply using patch. The regular git --diff does not work. Try this instead:

git diff --no-prefix > some_file.patch

Then somewhere else you can reverse it:

patch -p0 < some_file.patch