为多个 git-svn 存储库创建主 git 存储库
我有一个由多项服务组成的项目, 每个都在自己的 SVN 存储库中,并且构建脚本将每个 SVN 存储库检出为单个 /project
目录中的文件夹以及 /project
级别 Makefile< /code> 递归构建整个项目。
从视觉上看,它看起来像这样:
/project
Makefile
/service1 # First service (SVN repository)
/.svn
/service2 # Second service (SVN repository)
/.svn
...
我正在尝试将项目转换为单个可共享的 git 存储库,以便与团队成员协作,而不删除提交回原始 SVN 存储库的功能。
我当前的想法是使用 git-svn 检查每个 SVN 存储库(/service1
、/service2
等),然后在/project
级别将它们分组到单个存储库中。假设的项目结构看起来像这样:
/project
/.git # Master git repository
Makefile
/service1 # First service (SVN repository)
/.git # .git directory for git-svn checkout of service 1
/service2 # Second service (SVN repository)
/.git # .git directory for git-svn checkout of service 2
...
这可行吗?有没有更简单的解决方案?
注意:我没有权限重新定义项目结构或SVN存储库的结构。
I have a project which consists of several services,
each in their own SVN repository and a build script that checks out each SVN repository as a folder in a single /project
directory along with a /project
level Makefile
to recursively build the whole project.
Visually it looks something like this:
/project
Makefile
/service1 # First service (SVN repository)
/.svn
/service2 # Second service (SVN repository)
/.svn
...
I am trying to convert the project into a single shareable git repository to collaborate with teammates on without removing the ability to commit back to the original SVN repositories.
My current idea is to check out each SVN repository (/service1
, /service2
, etc.) using git-svn and then create a master git repository at the /project
level to group them into a single repository. The hypothesized project structure would look something like this:
/project
/.git # Master git repository
Makefile
/service1 # First service (SVN repository)
/.git # .git directory for git-svn checkout of service 1
/service2 # Second service (SVN repository)
/.git # .git directory for git-svn checkout of service 2
...
Will this work? Is there a simpler solution?
Note: I do not have the authority to redefine the project structure or the structure of the SVN repositories.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可以工作,只要您将
/project
视为父存储库,并将servicexx
git 存储库引用为 子模块。这样,其他协作者只能引用父存储库,并取回其中的所有子模块。
正如“子模块的真实性质”中所述,他们可以在其中创建/签出分支这些子模块并开始修改它们。
确保有一个分支专用于 git svn dcommit(合并回 SVN):
请参阅“克服 git svn 警告”和“使用 git-svn 在 svn 中轻松合并”。
It can work, provided you consider
/project
as a parent repository referencing theservicexx
git repos as submodules.That way, other collaborators can reference only the parent repo, and get back all the submodules in it.
As explained in "True Nature of submodules", they can then create/checkout branches within those submodules and start modifying them.
Make sure though than one branch is dedicate for
git svn dcommit
(merge back to SVN):See "Overcome git svn caveats" and "Easy merging in svn using git-svn".