如何将Resharper文件保留在SVN之外?

时间:2023-01-13 21:42:19

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.

我正在使用VS2008和Resharper。 Resharper创建一个目录_Resharper.ProjectName。这些文件没有为我所知道的源控件提供任何值,并且在提交更改时会导致问题。如何让SVN忽略它们?我使用TortoiseSVN作为我的SVN界面。

EDIT: You guys are fast.

编辑:你们很快。

9 个解决方案

#1


14  

Here's a link to show the ignoring process in TortoiseSVN

这是一个显示TortoiseSVN忽略过程的链接

#2


11  

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

将文件名(甚至模式_Resharper。*)添加到其父目录的svn:ignore属性中。

#3


7  

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

在我输入这个内容之后阅读手册时,我会在这里发布一个自己问题的答案。在TortoiseSVN中,转到设置。加

*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.

到“全球忽视模式”。将项添加到全局忽略模式意味着对于安装了TortoiseSVN的客户端所处理的任何项目,将忽略这些文件,因此在所有情况下使用全局忽略可能不合适。

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.

如果您在TortoiseSVN菜单中添加特定文件和目录之前将其添加到存储库中,则还可以将特定文件和目录添加到单个项目的忽略列表中。 “BEFORE”部分是我最初绊倒的原因。由于这是一个单独的开发人员项目,我一直在检查二进制文件,等等。对于其他开发人员,它没有任何后果,Resharper文件也在那里。

#4


4  

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

将Resharper缓存存储在系统临时文件夹中。检查r#中的第一个设置页面。环境 - >常规 - >系统 - >存储缓存..

#5


3  

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

请查看将Resahrper缓存存储在系统TEMP文件夹中的答案。

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

这样你甚至不会意外地将它添加到任何版本控制系统 - 而不仅仅是SVN。

#6


2  

Short answer: the "svn:ignore" property

简短回答:“svn:ignore”属性

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)

(在自己的行上添加“_Resharper.ProjectName”并写出文件)

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

编辑:erg ... doh,刚刚意识到你说龟...这就是你用SVN命令行版本的方法

#7


1  

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.

svn有一个“ignore”属性,你可以附加到文件名模式或目录。忽略的文件和目录不会在“svn st”命令中报告,也不会进入仓库。

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.

示例:您在.c和.h文件中有C源代码,但编译器会创建一堆.o文件,您不希望subversion打扰告诉您。您可以使用Subversion的属性功能告诉它忽略这些。

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

对于一个签出工作目录中的一些文件,例如myproject / mysource /

bash> svn propedit svn:ignore mysource

bash> svn propedit svn:忽略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).

在弹出的文本编辑器中(在linux中,可能是vi或者你的EDITOR env var设置的任何内容),每行添加一个文件名模式。不要在模式后面放置一个尾随空格(这会混淆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)

就这样。您可能希望立即进行提交,因为有时svn会对用户在提交之间对文件进行太多不同类型的更改变得挑剔。 (我的规则是:如果有疑问,提交。它很便宜)

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.

对于出现在庞大目录树中许多位置的文件类型,请编辑保存在存储库中的subversion配置文件。这需要存储库管理员的操作,除非您可以直接访问存储库(不是通过svn:或http:或file:,而是可以'cd'到存储库位置并且'ls'是其文件)。 svn书应该有详细信息;我现在不记得了。

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!)

由于我不使用Tortoise,我不知道上面的描述是如何直接翻译的 - 但这就是为什么我们有可编辑的答案(快乐!)

#8


0  

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/

这篇博文提供了一个如何通过命令行svn执行所需操作的示例。 http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/

These change will be reflected in TortoiseSVN.

这些变化将反映在TortoiseSVN中。

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

我相信有一种方法可以通过乌龟来做到这一点,但我没有Windows vm可访问atm,对不起:(

#9


-3  

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.

SVN仅控制您在创建存储库时放入的内容。不要只导入整个项目文件夹,而是在进行构建之前导入“干净”文件夹。在构建之后,您将获得所有目标文件或_Resharper文件夹等,但它们不受版本控制。

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.

#1


14  

Here's a link to show the ignoring process in TortoiseSVN

这是一个显示TortoiseSVN忽略过程的链接

#2


11  

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

将文件名(甚至模式_Resharper。*)添加到其父目录的svn:ignore属性中。

#3


7  

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

在我输入这个内容之后阅读手册时,我会在这里发布一个自己问题的答案。在TortoiseSVN中,转到设置。加

*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.

到“全球忽视模式”。将项添加到全局忽略模式意味着对于安装了TortoiseSVN的客户端所处理的任何项目,将忽略这些文件,因此在所有情况下使用全局忽略可能不合适。

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.

如果您在TortoiseSVN菜单中添加特定文件和目录之前将其添加到存储库中,则还可以将特定文件和目录添加到单个项目的忽略列表中。 “BEFORE”部分是我最初绊倒的原因。由于这是一个单独的开发人员项目,我一直在检查二进制文件,等等。对于其他开发人员,它没有任何后果,Resharper文件也在那里。

#4


4  

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

将Resharper缓存存储在系统临时文件夹中。检查r#中的第一个设置页面。环境 - >常规 - >系统 - >存储缓存..

#5


3  

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

请查看将Resahrper缓存存储在系统TEMP文件夹中的答案。

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

这样你甚至不会意外地将它添加到任何版本控制系统 - 而不仅仅是SVN。

#6


2  

Short answer: the "svn:ignore" property

简短回答:“svn:ignore”属性

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)

(在自己的行上添加“_Resharper.ProjectName”并写出文件)

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

编辑:erg ... doh,刚刚意识到你说龟...这就是你用SVN命令行版本的方法

#7


1  

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.

svn有一个“ignore”属性,你可以附加到文件名模式或目录。忽略的文件和目录不会在“svn st”命令中报告,也不会进入仓库。

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.

示例:您在.c和.h文件中有C源代码,但编译器会创建一堆.o文件,您不希望subversion打扰告诉您。您可以使用Subversion的属性功能告诉它忽略这些。

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

对于一个签出工作目录中的一些文件,例如myproject / mysource /

bash> svn propedit svn:ignore mysource

bash> svn propedit svn:忽略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).

在弹出的文本编辑器中(在linux中,可能是vi或者你的EDITOR env var设置的任何内容),每行添加一个文件名模式。不要在模式后面放置一个尾随空格(这会混淆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)

就这样。您可能希望立即进行提交,因为有时svn会对用户在提交之间对文件进行太多不同类型的更改变得挑剔。 (我的规则是:如果有疑问,提交。它很便宜)

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.

对于出现在庞大目录树中许多位置的文件类型,请编辑保存在存储库中的subversion配置文件。这需要存储库管理员的操作,除非您可以直接访问存储库(不是通过svn:或http:或file:,而是可以'cd'到存储库位置并且'ls'是其文件)。 svn书应该有详细信息;我现在不记得了。

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!)

由于我不使用Tortoise,我不知道上面的描述是如何直接翻译的 - 但这就是为什么我们有可编辑的答案(快乐!)

#8


0  

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/

这篇博文提供了一个如何通过命令行svn执行所需操作的示例。 http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/

These change will be reflected in TortoiseSVN.

这些变化将反映在TortoiseSVN中。

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

我相信有一种方法可以通过乌龟来做到这一点,但我没有Windows vm可访问atm,对不起:(

#9


-3  

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.

SVN仅控制您在创建存储库时放入的内容。不要只导入整个项目文件夹,而是在进行构建之前导入“干净”文件夹。在构建之后,您将获得所有目标文件或_Resharper文件夹等,但它们不受版本控制。

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.