Removing and ignoring files and directories with Subversion

I’m using Subversion 1.6 for version control. I manage source code with it which is often stored in a project folder of some IDE like Netbeans.

Problem I: some of the files in the project directory are machine-specific and should not be added to SVN in the first place.

If you did NOT already add them, you can make SVN ignore them with a command like this:

svn propedit svn:ignore ./nbproject/private/

SVN will open an editor, just type the patters you want to ignore, using the * wildcard syntax. Here’s an example:


*.tmp
test*
*

Problem II: I often add a whole directory tree and discover only afterwards that some of the files need to be ignored.

In this case, you have to remove the files from SVN first before you can ignore them (but read below before you execute this command):

cd nbproject
svn rm private

Problem III: But what if you need a local copy of the files for your IDE, i.e., you want to delete them from the repo on the server but NOT locally?

In this case, do the same as above but use the keep local option:
cd nbproject
svn rm --keep-local private

Hope it helps someone else, too.

Advertisements

About dfspspirit

PhD student in bioinformatics, interested in photography, level design, digital image manipulation, architecture and, of course, bioinformatics.
This entry was posted in coding, tools and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s