我最近加入了一个新团队。该团队一直使用 Subversion 进行源代码控制。他们让我研究一下将源代码移至 Git 的可能性。
这似乎是一个微不足道的练习,直到我意识到他们有大量的 svn:externals。该项目是一个大型 Java EE 项目,由多个 Web 项目组成。团队使用 svn:externals 在各个项目之间共享一些固定资源(如 css、javascript 等)。
我的问题有两个:
- 是否有更好的策略可以在一组 Java 项目中共享资源,让我们不再需要 svn:externals 并使转向 git 变得更简单?
- 如果不存在更好的策略,那么我的替代方案是什么?
这是一个相当大的代码库(很多修订和文件),所以我想利用 git 的性能。
这是他们正在使用的相关软件堆栈:
- 颠覆
- eclipse
- Maven (2.2.1 IIRC)
- Windows(用于开发)、AIX(用于生产)
谢谢
最佳答案
听起来像是 Git 子模块的一个很好的例子。它们应该与 svn:external
s 非常相似。
摘自 Git 书籍:
It often happens that while working on one project, you need to use another project from within it. Perhaps it’s a library that a third party developed or that you’re developing separately and using in multiple parent projects. A common issue arises in these scenarios: you want to be able to treat the two projects as separate yet still be able to use one from within the other.
阅读 Git 书籍中有关 Git 子模块的更多信息:http://book.git-scm.com/5_submodules.html
关于java - 复制 svn :externals with git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11954408/