Produce a diff compatible with patch command
suggest changeSometimes you need a diff that patch can apply. A normal git diff prefixes paths with a/ and b/, so apply that output with patch -p1. To drop the prefixes and apply with patch -p0:
git diff --no-prefix > some_file.patch
Then somewhere else you can reverse it:
patch -p0 < some_file.patch
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents