VCS 中半忽略的文件 - 支持吗?
我正在使用 Eclipse 和 Subversion 进行 Java 开发,并且我发现自己希望版本控制系统中有一项功能(据我所知,SVN 中不提供该功能)。
我希望我的项目设置文件被半忽略。更准确地说,我希望它们在 VCS 中可用,我希望在有人签入更改时发生合并,但是。我希望我自己的更改被忽略,除非我非常明确地告诉系统接受它们。
这将允许我在本地配置中拥有本地路径(和其他设置),而不会搞乱其他人的配置。但是,当我有重大更改时,我仍然可以将其签入(非常非常仔细,可能会暂时删除我的其他本地更改)并将其交付给其他人。
现在,真正的问题是:是否有任何 VCS 支持此功能?或者可能是我在 SVN 中遗漏了一些东西?其他人在 Eclipse 中是如何解决这个问题的?
I am using Eclipse and Subversion for Java development, and I find myself wishing for a feature in version control systems (one that is not available in SVN, to the best of my knowledge).
I would like my project settings files to be half-ignored. To be more precise, I want them to be available in VCS, I want merge to occur when someone checks in changes, but. I want my own changes ignored unless I very explicitly tell the system to take them.
This would allow me to have my local paths (and other settings) in my local configuration w/o screwing up other people's configuration. But, when I have a substantial change, I can still check it in (very very carefully, may be temporarily removing my other local changes) and have it delivered to other people.
Now, the actual question: is there any VCS that supports this feature? Or may be I am missing something in SVN? How do other people solve this problem in Eclipse?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
git 支持这一点
并补充
参见 http:// /blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files 和 http://kernel.org/pub/software/scm/git/docs/git-update-index.html#_options 的更多细节。
git supports this with
and the complementary
See http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files and http://kernel.org/pub/software/scm/git/docs/git-update-index.html#_options for more details.
是的,Git 通过过滤器驱动程序支持该功能(
干净
脚本 可以在提交时运行,允许您根据需要清除任何更改中的内容)。但另一种方法是从不版本化该设置文件,并且仅版本:
这样,您就可以随心所欲地修改它,而无需提交更改。
Yes, Git support that feature through filter driver (a
clean
script can run upon commit, allowing you to clean the content from any of your changes if you want).But another way would be to never version that setting file, and only version:
That way, you can modifying it at your heart's content without ever committing your changes.
.gitignore 用于 git,.hgignore 用于 Mercurial,并且可以添加不会提交的文件路径和模式。 SVN 中也有类似的东西,但我自己从来没有弄清楚如何使用它,但我的管理员确实帮我设置了它。
.gitignore for git, .hgignore for mercurial and file paths and patterns can be added that will not be committed. There similar in SVN but i never worked out how to use it myself but my sysop did set it up form me.