eclipse 无法将文件或文件夹添加到 svn:ignore
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16646942/
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
Unable to add file or folder to svn:ignore
提问by Oh Chin Boon
I have some files and folders that i am unable to add to ignore because the option is disabled. Why is this so?
我有一些文件和文件夹我无法添加忽略,因为该选项被禁用。为什么会这样?
回答by Nathaniel Waisbrot
The problem is that the folder is already under version control.
问题是该文件夹已经在版本控制之下。
Here's how I fix this type of problem when it comes up:
以下是我解决此类问题时的方法:
- In your local shell, make a copy of the
.settings
folder - Bring up the "SVN Repositories" view in Eclipse
- Navigate to within the project on the server (e.g.
/trunk/cboon/Project1/
) - Right-click the
.settings
directory there and delete it - Now locally, update the project. If it feels that
.settings
is in conflict, accept the incoming change. - Copy your local back-up of
.settings
back into place and refresh. It should now have a '?' badge, indicating that it's not under control - Nowyou can
svn:ignore
it
- 在本地 shell 中,复制该
.settings
文件夹 - 在 Eclipse 中调出“SVN Repositories”视图
- 导航到服务器上的项目内(例如
/trunk/cboon/Project1/
) - 右键单击
.settings
那里的目录并将其删除 - 现在在本地,更新项目。如果感觉
.settings
有冲突,请接受即将到来的更改。 - 将您的本地备份复制
.settings
到位并刷新。它现在应该有一个“?” 徽章,表明它不受控制 - 现在你可以
svn:ignore
了
回答by nosid
Most likely, the file has already been added to the ignore list (svn:ignore), has also been added to the repository, and now contains some changes. The ignore list is only used for unversioned files. However, if the file is already in the repository, it has no effect.
最有可能的是,该文件已经添加到忽略列表 ( svn:ignore) 中,也已添加到存储库中,现在包含一些更改。忽略列表仅用于未版本控制的文件。但是,如果该文件已在存储库中,则它不起作用。
Solve the problem by removing the file from the repository, without removing it from your working copy, e.g. svn rm --keep-local .settings
.
通过从存储库中删除文件来解决问题,而不是从您的工作副本中删除它,例如svn rm --keep-local .settings
.
回答by davmos
"You can use svn:ignore property only for unversioned resources, if resource is versioned then "Add to svn:ignore" menu is disabled. In order to add resource to ignored, select unversioned resource which you want to ignore, right click and call Team/Add to svn:ignore, then select ignore method."
“您只能对未版本化的资源使用 svn:ignore 属性,如果资源已版本化,则禁用“添加到 svn:ignore”菜单。要添加要忽略的资源,请选择要忽略的未版本化资源,右键单击并调用团队/添加到 svn:ignore,然后选择忽略方法。”
Taken from discussion here.
取自这里的讨论。