Monday, January 16, 2012

How to apply `git diff` patch?

Reference: How to apply `git diff` patch?
How can my client apply patch created by git diff without git installed? I have tried to use patchcommand but it always asks file name to patch.


Answer:
1. git diff --no-prefix > patchfile, patch -p0 < patchfile
2. git apply file.diff
3. git diff > patchfile, patch -p1 < patchfile

No comments: