我想开始将 git-svn 用于使用中央 SVN 存储库的项目。问题是我们使用的是 Windows,而 SVN 项目使用外部组件以便能够在两个不同的项目中重用一些代码。在 Unix 系统中,我们会使用软链接(soft link),但由于我们坚持使用 windows,我们决定使用外部作为 windows xp 中限制的解决方法。如果您对此有更好的解决方案,我们将非常高兴听到这个消息! svn结构如下:
branch
tag
trunk
-web
--views
---External to commonFiles
-admin
--views
---External to commonFiles
-commonFiles
我可以使用 git-svn 吗?如果可以,我该怎么做?
编辑 很长一段时间以来,我一直在寻找好的解决方案,但在写完这篇文章后,我开始思考这实际上与 svn:externals 有多大关系。如果我使用 git svn 我会得到这个
branch
tag
trunk
-web
--views
---commonFiles (empty folder since externals didn't work)
-admin
--views
---commonFiles (empty folder since externals didn't work)
-commonFiles
既然我在 git 中有 commonFiles 文件夹,我可以在 git 中使用与 svn 中相同的技术吗?要将空的 commonFiles 文件夹链接到使用 git 维护的 commonFiles?
最佳答案
是的,您应该能够通过 git 子模块获得 git 等价物。 .git 文件夹和 .gitmodules 文件将存在于与 web 和管理员 check out 相同的级别。 .git 文件夹将存在于外部文件夹中。你会想忽略 git 中的 .svn 文件夹,反之亦然。
希望这对您有所帮助!
关于svn - Git SVN 和外部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4261457/