eclipse 子剪辑 svn:ignore

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

Subclipse svn:ignore

eclipsesvnsubclipse

提问by KevMo

I'm new to Eclipse. I'm using subclipse for connecting to my SVN. There are some folders and files I would like to add to svn:ignore, but it's grayed out. Is there an easy way to get subclipse to ignore files and directories?

我是 Eclipse 的新手。我正在使用 subclipse 连接到我的 SVN。有一些文件夹和文件我想添加到 svn:ignore,但它是灰色的。有没有一种简单的方法可以让 subclipse 忽略文件和目录?

subclipse

子剪辑

回答by Henrik

You can't svn:ignore a file that is already commited to repository.

您不能 svn:ignore 已提交到存储库的文件。

So you must:

所以你必须:

  1. Delete the file from the repository.
  2. Update your project (the working copy) to the head revision.
  3. Recreate the file in Eclipse.
  4. Set svn:ignore on the file via Team->Add to svn:ignore.
  5. Restart eclipse to reflect changes.
  1. 从存储库中删除文件。
  2. 将您的项目(工作副本)更新到主要修订版。
  3. 在 Eclipse 中重新创建该文件。
  4. 通过 Team->Add to svn:ignore 在文件上设置 svn:ignore。
  5. 重新启动 eclipse 以反映更改。

Good luck!

祝你好运!

回答by Robert Swift

I was able to do this using TortoiseSVN directly from Windows explorer:

我可以直接从 Windows 资源管理器中使用 TortoiseSVN 来做到这一点:

Right click on file to ignore->TortiseSVN->Delete and add to ignore list

右键单击要忽略的文件TortiseSVN-> ->Delete and add to ignore list

I had to close then re-open the project in Eclipse, job done :)

我不得不关闭然后在 Eclipse 中重新打开项目,工作完成:)

回答by cosmos

It seems Subclipse only allows you to add a top-level folder to ignore listand not any sub folders under it. Not sure why it works this way. However, I found out by trial and error that if you directly add a sub-folder to version control, then it will allow you to add another folder at the same level to the ignore list.

似乎 Subclipse 只允许您添加一个顶级文件夹来忽略列表,而不是它下面的任何子文件夹。不知道为什么它会这样工作。但是,我通过反复试验发现,如果您直接将子文件夹添加到版本控制,那么它将允许您将另一个相同级别的文件夹添加到忽略列表中。

alt text

替代文字

For example, refer fig above, when I wanted to ignore the webappfolder without adding src, subclipse was not allowing me to do so. But when I added the javafolder to version control, the "add to svn:ignore..." was enabled for webapp.

例如,参考上图,当我想在不添加src 的情况下忽略webapp文件夹时,subclipse 不允许我这样做。但是当我将java文件夹添加到版本控制时,为webapp启用了“添加到 svn:ignore...” 。

回答by narko

If you are trying to share a project in SVN with Eclipse for the first time, you might want to avoid certain files to be commited. In order to do so, go to Preferences->Team->Ignored Resources. In this screen you just need to add a pattern to ignore the kind of files you don't want to commit.

如果您是第一次尝试在 SVN 中与 Eclipse 共享项目,您可能希望避免提交某些文件。为此,请转到首选项-> 团队-> 忽略的资源。在此屏幕中,您只需要添加一个模式来忽略您不想提交的文件类型。

Eclipse preferences

Eclipse 首选项

回答by nenad_naukovic

Working with Subclipse on Eclipse Indigo Service Release 2

在 Eclipse Indigo Service Release 2 上使用 Subclipse

I had commited folders with temporary files and logs lying under /src to the SVN repository. And after realizing it, I found myself in the same situation with a grayed out "svn:ignore"

我已将包含 /src 下的临时文件和日志的文件夹提交到 SVN 存储库。意识到这一点后,我发现自己处于同样的情况,“svn:ignore”变灰

I found following solution:

我找到了以下解决方案:

1. I deleted the folder from my Project Source

1.我从我的项目源中删除了文件夹

2. Team -> Commit... withouth the folder

2.团队->提交...没有文件夹

3. Recreated the folder back into the project tree

3. 将文件夹重新创建回项目树

Now I was able to use "Team -> Add to svn:ignore..."

现在我可以使用“Team -> Add to svn:ignore...”

回答by mambolis

What worked for me was following : (eclipse 3.3.6 Subclipse 2.4)

对我有用的是:(eclipse 3.3.6 Subclipse 2.4)

  • set svn:ignore property via tortoise : ( .settings .classpath .project target .apt_src one item at one line)
  • deleted the project from the eclipse
  • fresh checkout from the svn
  • import the project in eclipse (simple reimporting the project in eclipse did not worked for me)
  • 通过 tortoise 设置 svn:ignore 属性:( .settings .classpath .project target .apt_src 一行一行)
  • 从eclipse中删除了项目
  • 从 svn 新鲜结帐
  • 在 eclipse 中导入项目(在 eclipse 中简单地重新导入项目对我不起作用)

回答by Dave Markle

This is just a WAG as I am not a Subclipse user, but have you ensured that the folders containing what you're trying to ignore have themselves been added to SVN? You can't svn:ignore something inside a folder that's not under version control.

这只是一个 WAG,因为我不是 Subclipse 用户,但是您是否确保包含您要忽略的内容的文件夹本身已添加到 SVN?您不能 svn:ignore 文件夹中不受版本控制的内容。

回答by Kevin Day

I just figured out how to do this:

我只是想出了如何做到这一点:

It appears that when you add a parent folder to version control, Eclipse adds all sub-folders. Once the sub-folders are added to version control, it is not possible to ignore them.

似乎当您将父文件夹添加到版本控制时,Eclipse 会添加所有子文件夹。一旦将子文件夹添加到版本控制中,就不可能忽略它们。

Here's how to do it:

这是如何做到的:

Right click on the top level folder and add to version control Right click on the child folder you want to ignore, revert Right click on the child folder you want to ignore, svn:ignore (which will now be available)

右键单击顶级文件夹并添加到版本控制右键单击要忽略的子文件夹,还原右键单击要忽略的子文件夹,svn:ignore(现在将可用)

回答by aloksahoo

to ignore certain files or turn off ignoring you can use the eclipse preferences-->Team -->Ignored Resource. Check or uncheck the resources you want to be tracked.

要忽略某些文件或关闭忽略,您可以使用 eclipse 首选项--> 团队 --> 忽略的资源。选中或取消选中要跟踪的资源。

回答by Juan Calero

One more thing... If you already ignored those files through Eclipse (with Team -> Ignored resources) you have to undo these settings so the files are controlled by Subclipse again and "Add to svn:ignore" option reappears

还有一件事...如果您已经通过 Eclipse(使用 Team -> Ignored resources)忽略了这些文件,您必须撤消这些设置,以便 Subclipse 再次控制这些文件,并且“添加到 svn:ignore”选项再次出现