简体   繁体   English

具有文件级别控制的版本控制

[英]Version control with file level control

I currently use SVN and have a framework that I use on all of my projects, let's say this framework has lib directory with needed files. 我目前使用SVN,并且在所有项目中都有一个框架,可以说该框架具有包含所需文件的lib目录。 That directory is in a 'framework' repository so I can update it on every project. 该目录位于“框架”存储库中,因此我可以在每个项目上对其进行更新。 My problem is that in that lib directory I want to add a project specific file that should be in project specific repository not in 'framework' repository. 我的问题是,在该lib目录中,我想添加一个项目特定的文件,该文件应位于项目特定的存储库中,而不是在“框架”存储库中。 Is there a version control capable of doing this? 是否有能够执行此操作的版本控制?

It sounds like you have some project-specific files, and then some files that are applicable to multiple projects, so you want to store those in the repository in a way such that you don't have to duplicate them in each project-specific directory. 听起来您有一些特定于项目的文件,然后有一些适用于多个项目的文件,因此您希望将其存储在资源库中,而不必在每个特定于项目的目录中重复它们。

The solution is to store all of these directories in parallel, and for each project, check out the particular combination fo directories that you need. 解决方案是并行存储所有这些目录,对于每个项目,请检查所需的目录的特定组合。 The layout may not be what is needed to build the project, but that's not subversion's job -- that's your build script's job. 布局可能不是构建项目所需的布局,但这不是Subversion的工作-这是构建脚本的工作。 Write a build script that composes the project-specific and project-agnostic libraries together in the desired layout. 编写一个构建脚本,以所需的布局将项目专用库和项目不可知库组合在一起。

为什么不在项目专用存储库中为项目专用文件使用单独的lib目录?

If I understand you right, you want to create "overlays" of directories. 如果我理解正确,那么您想创建目录的“覆盖”。 I do not think any version-control systems do that. 我认为没有任何版本控制系统可以做到这一点。

  • you can have more than one lib directory: one for the common stuff, one for each project 您可以有多个lib目录:一个用于常见内容,一个用于每个项目

  • if you use Java and can get your head around Maven (big if...) you can have Maven manage your dependencies, rather then putting them in SVN 如果您使用Java并可以绕开Maven(如果...可以解决),则可以让Maven管理您的依赖项,而不是将其放入SVN

I am not 100% sure but I think IBM Clearcase may have that kind of capability. 我不确定100%,但是我认为IBM Clearcase可能具有这种功能。 I have used it about 4-5 years back. 我已经使用了大约4-5年前。 It allows you to have links to files as well. 它也使您可以链接到文件。 So you can create links in the framework lib directory to files that belongs to projects. 因此,您可以在框架lib目录中创建指向属于项目的文件的链接。 But Clearcase is a beast, I don't know if you can even afford it. 但是Clearcase是野兽,我不知道您是否负担得起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM