Eclipse CVS 提交,忽略某些文件类型
我有一个相当大的项目,由很多...项目组成,每个项目都有自己的 Debug 和 Release 文件夹以及一堆我不想提交的其他文件,例如 .rc 和 .user。
目前,我右键单击顶部文件夹,单击提交,Eclipse 询问我如何存储它检测到的所有这些“新文件”,我如何告诉它我不想提交其中任何一个。
到目前为止,我已经读到我需要一个 .cvsignore 文件,但这似乎没有什么区别。我尝试对项目进行“清理”,但仍然有很多我不想要的文件。
有谁对如何至少减轻痛苦有任何建议吗?我什至尝试过对该项目进行一定的搜索。我不想要的文件并删除它们,但其中一些会重新创建自己......
注意:我通常只是通过单独选择它们来提交我想要的文件,但这次大约有 600 多个文件......
更新
抱歉花了这么长时间。感谢大家的回答,它们在技术上都是正确的,实际上没有一个对我有用,但我会将 Burhan 标记为最佳答案
我之前尝试过 cvs 忽略路线,但它似乎从未起作用,不幸的是它仍然没有起作用为我工作。
每个目录的方法似乎确实有效,但在这种情况下这是一个相当痛苦的过程。但 khmarbaise 是正确的,这是记录在案的方法,而且实际上是正确的。
Burhan提到的全局方法似乎很理想,但似乎不起作用,也许我误解了CVSROOT在哪里,我一直认为它是位于最顶层目录的“CVS”文件夹,它包括“Tag”等文件, “root”等这是错误的吗?
@thkala,“团队->添加到 .cvsignore”对我来说始终显示为灰色,因此无法使用,但当它确实有效时,这又是另一个有效的路线。
不过,我想我终于意识到为什么我在 CVS 和 Eclipse 方面遇到这么多问题,我想发布最终对我有用的内容以及 .cvsignore 路线实际上可能缺少的链接。
我总是这样检查项目:CVS Repositoris ->右键单击分支->签出为 ->在工作区中作为项目签出。
但是,我在 cvs 和索引 方面遇到这么多问题的原因是: *CVS 存储库 ->右键单击分支->签出为 ->签出为...新建项目向导。 ->重新输入分支 ->具有现有代码的 Makefile 项目*(作为旁注,有人知道如何指定新项目的目录吗?)
任何没有这样做并且不想重新签出的人都可以删除该项目并使用“新项目”重新添加它
此时“添加到 CVS 忽略”不再是灰色的。因此,如果您愿意,您现在可以使用该路线。
然而,此时我尝试了一些我之前没有使用过的东西团队->与存储库同步。这似乎只显示我所做的更改,因此没有任何“新文件”,这是我不想提交的所有文件。因此,我可以简单地仔细检查文件夹,然后对同步视图中的所有这些文件进行全面提交。值得注意的是,我实际上有一些构建生成的 .h 和 .c 文件,因此,如果我成功忽略某些文件,我仍然会签入这些不需要的文件(我想这是一线希望)。
也许我应该将问题改写为“大量提交”,以便对未来的 cvs + eclipse 新手更有帮助?有人同意吗?
I have a rather large project made up of lots of...projects, each with their own Debug and Release folders along with a bunch of other files that I don't really want to commit like .rc and .user.
At the moment I right click the top folder, click commit and eclipse asks how i would like to store all these "new files" it has detected, how do i tell it I don't want to commit any of them.
So far i have read that i need a .cvsignore file but that doesn't seem to make a difference. I tried doing a "clean" of the project but there was still plenty of files i don't want.
Does anyone have any advice on how to make this at the very least less painful? I have even tried doing a search on the project for certain . files I don't want and deleting them but some of them re-create themselves....
Note: I usually just commit the files I want by selecting them individually but this time it is about 600+ files...
UPDATE
Sorry for taking so long. Thank you to everyone for their answers, they are all technically correct, none actually worked for me, but i will mark Burhan as the best answer
I have tried the cvs ignore route before and it never seemed to work, unfortunately it still didn't work for me.
The per directory approach does seem to work but its quite a painful process in this case. But khmarbaise is correct this is the documented method, and is actually correct.
The Global method Burhan mentioned seemed ideal but didn't seem to work, Perhaps i have mis-understood where CVSROOT is, i always assumed it was the "CVS" folder located in the top most directory, it includes files like "Tag", "Root" etc. is this wrong?
@thkala, the "Team->Add to .cvsignore" was always greyed out for me and therefore could not be used but again is another valid route when it does work.
However I think i have finally realized why I have so many problems with CVS and eclipse and i would like to post what finally worked for me and what may actually be the missing link for the .cvsignore route.
I always checked the project out this way: CVS Repositoris -> Right click the branch -> check out as -> check out as project in the workspace.
However the reason i was having so many problems with cvs and indexing what i should have done is:
*CVS Repositoris -> Right click the branch -> check out as -> check out as ...New Project Wizard. -> retype branch -> Makefile Project with Existing code * (as a side note does anyone know how to specify the directory for the new project?)
Anyone who didn't do this and doesn't want to re-checkout can remove the project and re-add it using "new project"
At this point "Add to CVS ignore" was no longer greyed out. So you can now use that route if you want.
At this point however i tried something else i hadnt used before Team->synchronize with repo. This Seemed to bring up only the Changes i had made and therefore did not have any of the "new files" which was all the files i didn't want to commit. I was therefore able to simply double check the folders and then do a blanket commit on all those files in the sync view. It is really important to note that I actually had some build generated .h and .c files, so if i had succeeded in ignoring certain files, i would have still checked in these unwanted files (silver lining i suppose).
Perhaps i should rephrase the question to "large commit" to be more helpful to future cvs + eclipse newbies? anyone agree?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以为每个目录添加一个
.cvsignore
文件,其中包含您希望 cvs 忽略的目录中的文件。请注意,如果您希望这种情况持续存在,您也必须提交该文件。 @khmarbaise 指出了一些文档,其中讨论了您可以在此文件中放入什么样的内容。如果您想在全局范围内忽略某些文件类型,那么您应该检查
CVSROOT
模块并在该模块中的cvsignore
文件中进行添加(请注意,缺少名称开头的“点”)。不要忘记提交此更改以使其生效。.cvsignore
和cvsignore
文件可以包含相同类型的信息。You can add a
.cvsignore
file on a per-directory basis containing the files in the directory that you want cvs to ignore. Note that if you want this to persist, you will have to commit that file too. @khmarbaise pointed to some documentation that talks about what kind of thing you can put in this file.If you want to ignore certain file types on a global basis, then you should check out the
CVSROOT
module and make additions to thecvsignore
file in that module (note that lack of a "dot" at the start of the name). Don't forget to commit this change for it to take effect.Both
.cvsignore
andcvsignore
files can contain the same types of information.您可以创建一个名为 cvsignore 的文件,其中包含某些文件类型。我不记得它是叫“.cvsignore”还是“cvsignore”。查看文档。
You can create a file which is call cvsignore which contains certan file types. I can't remember if it's called ".cvsignore" or "cvsignore". Check the documentation.