I have two directories src
and src-with-fixes
. I want to make a unified patch, so people can download the src
dir and the patch file and run patch -p1 < patch.diff
and get the fixes in the src dir.
1 Answer
You could run:
diff -ruN src src-with-fixes > patch.diff
Where:
-r
means "recursive"-u
means "produce a unified format diff"-N
means "treat absent files as empty"
-
1Incidentally, using
git
(or other VCS) makes this process a little more manageable. Definitely worth looking into if you have not worked with a version control system before.– larsksAug 26, 2015 at 13:30 -