views:

1701

answers:

7

I'm getting confused with the include/exclude jargon and my actual SVN client doesn't seem to have (or I've been unable to find it easily) a simple option to add or remove a certain type of files for version control. Let's say for example I've added the entire Visual Studio folder, with its solutions, projects, debug files, et cétera, but I only want to version the actual source files. What would be the simplest way to do that?

Any comment would be much appreciated and thanks a lot in advance,

+1  A: 

At the lowest level, SVN allows you to ignore certain files or patterns with svn:ignore attribute. VS add-ins for SVN such as VisualSVN will automatically ignore those files on your behalf. If you're using TortoiseSVN, you can right-click files and folders in Explorer and choose Add to Ignore List.

HTH, Kent

Kent Boogaart
+3  A: 

This can be achieved using the svn:ignore property, or the global-ignores property in your ~/.subversion/config file. (Scroll to the top of that first link to see instructions on editing properties.)

By using svn propset or svn propedit on a directory, you will be able to make subversion ignore all files matching that pattern within the specific directory. If you change global-ignores in ~/.subversion/config's miscellany section, however, subversion will ignore such files no matter where they are located.

Max
Thank you for the comment!
Nano Taboada
+1  A: 

using the svn:ignore property, you can use wildcards

Prody
+9  A: 

You're probably safest excluding particular filetypes, rather than picking those you want to include, as you could then add a new type and not realize it wasn't versioned.

On a per-directory basis, you can edit the svn:ignore property.

Run

svn propedit svn:ignore .

each relevant directory to bring up an editor with a list of patterns to ignore.

Then put on each line a pattern corresponding to the filetype you'd like to ignore:

*.user
*.exe
*.dll

and what have you.

Alternatively, as has been suggested, you can add those patterns to the global-ignores property in your ~/.subversion/config file (or "%APPDATA%\Subversion\config" on Windows - see Configuration Area Layout in the red bean book for more information). In that case, separate the patterns with spaces. Here's mine. # at the beginning of the line introduces a comment. I've ignored Ankh .Load files and all *.resharper.user files:

### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output, and
### while importing or adding files and directories.
# global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store
global-ignores = Ankh.Load *.resharper.user
Blair Conrad
Thanks much for your reply! It's been quite informative.
Nano Taboada
+1  A: 

http://athenageek.wordpress.com/2008/04/16/svnignore/

I know using TortoiseSVN that I can click on a root folder where I have something checked out and can add arbitrary properties by selecting the "Properties" menu item. In this case you would just specify file patterns to exclude.

The blog above is for command line stuff but I'm sure it will work fine with whatever client you're using.

MattC
A: 

Is it possible to include files in the repository but not have SVN track differences. for example. I want jpegs in with my site, but i dont care about being able to diff them.

Is there a way to prevent svn from spending too much time thinking about these kind of binary files?

Greg B