windows 使用 TortoiseSVN 时从提交中排除 Eclipse 隐藏的“.settings”目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2175958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:51:54  来源:igfitidea点击:

Exclude Eclipse's hidden '.settings' directory from commits when using TortoiseSVN

windowseclipsesvntortoisesvn

提问by Camsoft

I'm using the TortoiseSVN client and Eclipse. When I attempt to commit an Eclipse project, TortoiseSVN displays a .settingsdirectory in the file list and says that it is un-versioned. The `.settings' directory seems to be where Eclipse keeps all of its settings for a project.

我正在使用 TortoiseSVN 客户端和 Eclipse。当我尝试提交一个 Eclipse 项目时,TortoiseSVN.settings在文件列表中显示一个目录并说它是未版本化的。`.settings' 目录似乎是 Eclipse 保存项目所有设置的地方。

Is there a way to exclude this directory so that it is completely ignored by TortoiseSVN for this and any other Eclipse projects?

有没有办法排除这个目录,以便 TortoiseSVN 完全忽略这个和任何其他 Eclipse 项目?

采纳答案by Michael Hackner

Since you want to ignore this folder globally, you should use…a global ignore!

既然你想全局忽略这个文件夹,你应该使用……全局忽略!

Take a look at the file

看一下文件

%APPDATA%\Subversion\config

and uncomment the global-ignoresline and add .settingsto it.

并取消注释该global-ignores行并添加.settings到其中。



Sample

样本

Sample full path for the file config:

文件的完整路径示例config

C:\Documents and Settings\pmn\Application Data\Subversion\config

Sample new content of the global-ignoresline:

global-ignores行的新内容示例:

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store .settings

回答by Kezzer

You can exclude directories like this by right clicking on them in Windows and going to TortoiseSVN/"Delete and add to ignore list" and then specifying it in the sub-menu:

您可以通过在 Windows 中右键单击它们并转到 TortoiseSVN/“删除并添加到忽略列表”然后在子菜单中指定它来排除这样的目录:

Enter image description here

Enter image description here

This is really easy to do, I have to do it quite often.

这真的很容易做到,我必须经常这样做。

回答by Andrey Adamovich

You can specify resources to ignore under Window -> Preferences -> Team -> Ignored resources.

您可以在 Window -> Preferences -> Team -> Ignored resources 下指定要忽略的资源。

回答by Tom

If you're using Eclipse you might want to try out subClipse, it's a free subversion plugin for eclipse and it will allow you to exclude the .setings folder. See this link.

如果您正在使用 Eclipse,您可能想试用 subClipse,它是 Eclipse 的免费 subversion 插件,它允许您排除 .settings 文件夹。请参阅此链接

However, are you sure you don't want these to be comitted? Since your project is build in Eclipse, one could say that the setings are a part of your project.

但是,您确定不希望提交这些内容吗?由于您的项目是在 Eclipse 中构建的,因此可以说这些设置是您项目的一部分。

Personally I like to commit these files as they allow me to keep the same settings for every project on every location and for every developer.

我个人喜欢提交这些文件,因为它们允许我为每个位置和每个开发人员的每个项目保留相同的设置。