What’s the diff?

Don’t mind me, just posting something on my blog for later retrieval, that is how to create patch in unified format. I always forget.

diff -uNr file1 file2 > patch

Don’t know why I can’t remember, it’s so simple; “u” for “unified”, “N” for “new file” and “r” for “recursive” (if needed). I always get stuck with capital Urn.. it’s not an Urn, it’s not an Urn. Now that I’ve forced myself to blog it, it’s ingrained in my brain!

3 thoughts on “What’s the diff?

  1. I usually add “-d” (“Try hard to find a smaller set of changes”) so that it spells “-Nurd”, which is easier to remember 🙂

    “-p” is also useful when diffing code because it shows the function names.

Leave a Reply

Your email address will not be published. Required fields are marked *