diff has an option --recursive (-r) to do a comparison between two directories (the files inside them). Is there a way to make diff ignore certain sub-directories (eg: .svn)?

$ diff -r src1/ src2/
link|improve this question

59% accept rate
feedback

2 Answers

up vote 19 down vote accepted

Add --exclude=".svn" as an option like so:

$ diff -r --exclude=".svn" src1/ src2/
link|improve this answer
2  
If you want to exclude multiple items just add another --exclude parameter. – JonMR Jul 12 '11 at 16:02
feedback
  diff --exclude=.svn ...
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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