diff patch

Jul. 3rd, 2010 12:06 am
anarres: (Default)
Make a patch:

$ diff -u oldfile newfile >> file.patch

(> overwrites, >> appends). The -u means unified format. Apply patch to (some other version of) oldfile (yes it does have to have the same name, no you don't have to specify the name, it figures out on its own which file to apply the patch to, and yes it does overwrite the old version):

$ patch > file.patch

Creating a patch that creates a new file: to do this you have to compare directories, not files. Yikes! Before doing anything else get Dreamhack up to date, and then get rid of all the clutter.

To make a patch comparing directories:

diff -u -r -N ~/temp4 ~/temp5 > folder.patch

the -r makes it recursive, and the -N means new files can be created as part of the patch.

Profile

anarres: (Default)
anarres

July 2012

S M T W T F S
1234567
891011121314
151617 18192021
222324 25262728
293031    

Syndicate

RSS Atom

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 5th, 2025 05:05 pm
Powered by Dreamwidth Studios