eclipse 添加到 svn:ignore 在 subclipse 中变灰

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12463815/
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-10 21:19:20  来源:igfitidea点击:

Add to svn:ignore greyed out in subclipse

eclipsesvnsubclipseignoresvnignore

提问by Edd

I have some files which I can't add to svn:ignore using subclipse and I don't know why.

我有一些文件无法使用 subclipse 添加到 svn:ignore ,我不知道为什么。

enter image description here

在此处输入图片说明

The usual reasons for not being able to add files to svn:ignore seem to be that the file is already in the repository or that the folder the file is in hasn't been created yet. Neither of these seem to apply here so I don't know what the cause is.

无法将文件添加到 svn:ignore 的常见原因似乎是该文件已经在存储库中,或者该文件所在的文件夹尚未创建。这些似乎都不适用于这里,所以我不知道原因是什么。

采纳答案by Mark Phippard

The file has clearly been added to version control. If this were the command line, then someone would have executed svn add but not yet committed the change. So the file is currently in the "scheduled-add" state. If you want to ignore the file, then first do Team > Revert to remove the scheduled add state. You will then be able to add it to svn:ignore for the parent.

该文件已明确添加到版本控制中。如果这是命令行,那么有人会执行 svn add 但尚未提交更改。所以文件当前处于“scheduled-add”状态。如果您想忽略该文件,请先执行 Team > Revert 以删除计划添加状态。然后,您将能够将其添加到 svn:ignore 以供父项使用。

UPDATE: When reverting files do not select files that are currently "unversioned". Reverting a file that is not versioned means Subclipse will delete the file. IF you ever accidentally delete something, note that Eclipse has a 'Restore from Local History' option. The items you removed will typically still be available in Local History.

更新:还原文件时不要选择当前“未版本化”的文件。恢复未版本化的文件意味着 Subclipse 将删除该文件。如果您不小心删除了某些内容,请注意 Eclipse 有一个“从本地历史恢复”选项。您删除的项目通常仍会在本地历史记录中可用。

回答by Mark Phippard

The answer above is very bad advice, Revert could delete everything if your files are not in SVN. The real answer is here: Subclipse svn:ignore, most likely cause for this issue is the parent folder is not added to svn.

上面的答案是非常糟糕的建议,如果您的文件不在 SVN 中,Revert 可能会删除所有内容。真正的答案在这里:Subclipse svn:ignore,这个问题最有可能的原因是父文件夹没有添加到 svn。

回答by Abdul Ahad

To SVN ignore a file you already checked in:

要 SVN 忽略您已经签入的文件:

1) Move the file from your workspace to a temporary directory
2) Team -> Synchronize with repository
3) Commit the file deletion
4) Copy the file back to your workspace
5) Refresh
6) Team -> Synchronize with repository
7) Add to .svnignore
8) Team -> Update (required for whatever reason)
9) Team -> Synchronize with repository
10) Commit changes to the parent folder

1) 将文件从您的工作区移动到临时目录
2) 团队 -> 与存储库同步
3) 提交文件删除
4) 将文件复制回您的工作区
5) 刷新
6) 团队 -> 与存储库同步
7) 添加到.svnignore
8) 团队 -> 更新(无论出于何种原因都需要)
9) 团队 -> 与存储库同步
10) 提交对父文件夹的更改

回答by geekinit

When I ran into this problem it was because I had already ignored it. Right click project and select Team and Show Properties. Keep in mind that svn:ignore is stored on the server so it will be there even after you pull down a project from the repo.

当我遇到这个问题时,是因为我已经忽略了它。右键单击项目并选择团队和显示属性。请记住, svn:ignore 存储在服务器上,因此即使您从 repo 中拉下一个项目,它也会在那里。

回答by BurninLeo

I tried a lot of ways to remove a folder from SVN version control. This is the only way that worked for me (Eclipse Mars):

我尝试了很多方法来从 SVN 版本控制中删除文件夹。这是对我有用的唯一方法(Eclipse Mars):

  • Close Eclipse
  • Open .svn/wc.db (in the local project copy) with an appropriate SQLite database editor
  • In table nodesremove the entry of the folder and it's subfolders
  • Commit the changes (if necessary)
  • Start Eclipse
  • 关闭日食
  • 使用适当的 SQLite 数据库编辑器打开 .svn/wc.db(在本地项目副本中)
  • 在表中nodes删除文件夹及其子文件夹的条目
  • 提交更改(如有必要)
  • 启动日食

That's it.

就是这样。

Note: To add a file or folder to svn:ignore, it's parental folder must be under version control. The above steps are only intended to remove a file from version control, that already is under version control.

注意:要将文件或文件夹添加到 svn:ignore,它的父文件夹必须处于版本控制之下。上述步骤仅用于从版本控制中删除已受版本控制的文件。