views:

1770

answers:

9

I am using VS2008 and Resharper. Resharper creates a directory _Resharper.ProjectName. These files provide no value for source control that I am aware of and cause issues when committing changes. How can I get SVN to ignore them? I am using TortoiseSVN as my interface for SVN.

EDIT: You guys are fast.

A: 

SVN only controls what you put into it when creating your repository. Don't just import your entire project folder but import a "clean" folder BEFORE doing a build. After the build you get all the object files or your _Resharper folder etc. but they are not version controlled.

I forgot: the

svn:ignore
command is another possibility to tell SVN to exclude certain files. You can add this as a property to the version controlled folders, e.g. with TortoiseSVN.

cschol
+7  A: 

Add the file names (or even the pattern _Resharper.*) to the svn:ignore property for its parent directory.

Daniel Spiewak
+2  A: 

Short answer: the "svn:ignore" property

Long answer:

# cd /your/working/copy
# export EDITOR=vi
# svn propedit svn:ignore .

(add "_Resharper.ProjectName" on its own line and write the file out)

Edit: erg... doh, just realized you said tortoise... this is how you do it with the command-line version of SVN

Your answer is a lot better than mine, I was just too lazy to figure out how to do it without Subversive. :-)
Daniel Spiewak
+4  A: 

Gonna post an answer to my own question here as I RTFM after I typed this up. In TortoiseSVN, goto settings. Add

*ReSharper*

to the "Global ignore pattern". Adding items to the global ignore pattern means that these files will be ignored for any project you work on for the client with TortoiseSVN installed, so it might not be appropriate to use the global ignore in all cases.

You can also add specific files and directories to the ignore list for individual projects if you select this from the TortoiseSVN menu BEFORE they have been added to your repository. The "BEFORE" part is what tripped me up originally. Since this is a single developer project, I've been checking in binaries, etc. b/c it has no consequence for other developers, and the Resharper files got in there.

JasonS
A: 

This blog post provides a example on how to do what you want on via command line svn. http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/

These change will be reflected in TortoiseSVN.

I believe there is a way to do it via tortoise however i don't have a windows vm accessible atm, sorry :(

Nolan Evans
+1  A: 

svn has an "ignore" property you can attach to a filename pattern or a directory. Files and directories that are ignored won't be reported in "svn st" commands and won't go into the repo.

Example: you have C source code in .c and .h files, but the compiler creates a bunch of .o files that you don't want subversion to bother telling you about. You can use Subversion's properties feature to tell it to ignore these.

For a few files in one checked-out working directory, for example myproject/mysource/

bash> svn propedit svn:ignore mysource

In the text editor that pops up (in linux, probably vi or whatever your EDITOR env var is set to), add one filename pattern per line. Do not put a trailing space after the pattern (this confuses svn).

*.o
*.bak

That's all. You may want to do a commit right away, since sometimes svn gets fussy about users making too many different kinds of changes to files between commits. (my rule is: if in doubt, commit. It's cheap)

For a type of file appearing in many places in a sprawling directory tree, edit the subversion config file kept inside the repository. This requires the repository administrator's action, unless you have direct access to the repository (not through svn: or http: or file:, but can 'cd' to the repository location and 'ls' its files). The svn books should have the details; i don't recall offhand right now.

Since i don't use Tortoise, i don't know how directly the description above translates - but that's why we have editable answers (joy!)

DarenW
+1  A: 

Look at this answer for storing the Resahrper cache in the system TEMP folder.

This way you can not even accidentally add it to any version control system - not just SVN.

CVD
+1  A: 

Store Resharper caches in system temp folder. Check First setting page in r#. Environment -> General -> System -> Store caches ..

UmaMaheswaran.S.G