Web Development » Quick SVN Tips for ignore and externals

Quick SVN Tips for ignore and externals

We work with SVN every day, but not every aspect of it. Some of the more commonly forgotten SVN features I always have to look up are ignore and externals – although they’re both pretty much the same to use. Here’s my preferred approach though – it enables you to use your favorite editor (vi, nano, etc etc etc). I prefer nano, but I’ve listed vi as well below.

Set your editor:

export SVN_EDITOR=nano
or
export SVN_EDITOR=vi

Move to the correct directory:

svn propedit svn:externals .
or
svn propedit svn:ignore .

The next part is easy, just enter the name of the local directory followed by the externals path, like so:

externals-folder http://myothersite.com/my-other-project/externals-folder/

And run svn up.

Or, if you’re doing svn ignore, same thing, but just the name of the folder or files to ignore.

file_to_ignore.ext
folder-to-ignore

Again, just run svn up.

Don’t forget though – these are not recursive, so if the directory you want to ignore is in /public/web/, then make sure to cd /public/web/ first. I hope that makes sense.

Comments