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.


You could run:

diff -ruN src src-with-fixes > patch.diff


  • -r means "recursive"
  • -u means "produce a unified format diff"
  • -N means "treat absent files as empty"
  • 1
    Incidentally, 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. – larsks Aug 26 '15 at 13:30
  • I know of Git and I use it, but for this I don't want to use Git – wb9688 Aug 26 '15 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.