Diff two source controlled directories

I constantly need to diff two directories just to check what files have changed between revisions.

When you do a CVS checkout of two separate branches whether they’re incremental or not, sometimes you need to check which files differ as a pre-check before doing something else. Here’s a little code snipped that will allow you to do just that:

diff -rbB --brief $1 $2  | egrep -v '(CVS|.svn|~|\.#)'

Throw that in a file named ‘diffdir’ or whatever you like in your ~/bin directory, make it executable and you’re good to go.

This entry was posted in Snippets. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>