我在工作中也有同样的情况。我使用 SmartGit。我在 Git 存储库根目录中有 .gitsvnextmodules 文件(提交给 Git)。
[submodule "anyString"]
path = path/to/svn/submodule
url = https://url.of.svn/repository/blah
revision = 1234
branch = branches/branch #or it can be "trunk"
fetch = trunk:refs/remotes/svn/trunk
branches = branches/*:refs/remotes/svn/*
tags = tags/*:refs/remote-tags/svn/*
remote = svn
type = dir
SmartGit 在修订版 1234 将其显示为指向“https://url.of.svn/repository/blah/branches/branch”(url+branch 值连接)的子模块(如果未指定,则使用 HEAD 修订版)。fetch+branches+tags 类似于 .git/config 规范。
如果您不想在 3rd 方项目的分支之间快速切换(我这样做是因为我也想提交一个子模块),请改用类似的东西。
[submodule "alternativeSubmodule"]
path = path/to/svn/submodule
url = https://url.of.svn/repository/blah/branches/branch
revision = 1234
branch = /
fetch = :refs/remotes/svn/git-svn
remote = svn
type = dir
.gitsvnextmodules规范中的更多详细信息。
对于此配置,SmartGit 与子模块的使用方式与普通 Git 子模块的使用方式相同。