Linux: diff two directory to create patch

diff -b -r -w <DIR1> <DIR2> -N  -x ‘*.o’ -x ‘*.cmd’ -x ‘*.builtin’ -x ‘*.order’ > g_ncm.patch

The -N option copies into the .patch files that exists in only one of the directory.

Option:

`-b'
     Ignore changes in amount of white space.  See White Space.
`-B'
     Ignore changes that just insert or delete blank lines.  
See Blank Lines.
`-r'
     When comparing directories, recursively compare any subdirectories
     found.  See Comparing Directories.
`-w'
     Ignore white space when comparing lines.  See White Space.
`-N'
`--new-file'
     In directory comparison, if a file is found in only one directory,
     treat it as present but empty in the other directory. 
`-x PATTERN'
     When comparing directories, ignore files and subdirectories whose
     basenames match PATTERN.  See Comparing Directories.
Advertisements
This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s