Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/
share|improve this question

2 Answers 2

up vote 58 down vote accepted

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

$ diff -r --exclude=".svn" src1/ src2/
share|improve this answer
5  
If you want to exclude multiple items just add another --exclude parameter. –  JonMR Jul 12 '11 at 16:02
5  
If you don't want to type --exclude every time use -x ".svn" –  spaceCamel Aug 14 '12 at 9:03
  diff --exclude=.svn ...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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