Ignore .svn when doing `diff -r`

43,827

Solution 1

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

$ diff -r --exclude=".svn" src1/ src2/

Solution 2

  diff --exclude=.svn ...
Share:
43,827

Related videos on Youtube

Sridhar Ratnakumar
Author by

Sridhar Ratnakumar

Updated on September 17, 2022

Comments

  • Sridhar Ratnakumar
    Sridhar Ratnakumar almost 2 years

    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/
    
  • Nate
    Nate almost 13 years
    If you want to exclude multiple items just add another --exclude parameter.
  • alpert
    alpert about 8 years
    --exclude option is also not working on mac os. -x ".svn" works well.
  • Michael Tuan Duong
    Michael Tuan Duong over 3 years
    --exclude works well on macOS 10.15.2, /usr/bin/diff 2.8.1