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?”
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.
Ahh.. that’s a good way to remember it, thanks! 🙂
-c
Yeah, I have always used -Nrup… -d can be pretty slow on big diffs, although -Nurd is terribly cute. 🙂