【问题标题】:Convert each directory within SVN trunk to different GIT repositories将 SVN 主干中的每个目录转换为不同的 GIT 存储库
【发布时间】:2021-12-18 17:01:59
【问题描述】:

我正在尝试将 SVN 存储库转换为 GIT 存储库。在我的 SVN /trunk 目录中,我有多个目录:

/trunk
  /apps
  /site
  /services
  /scripts
/branches
  ...
/tags
  ...

如果我运行命令git svn clone --authors-file=authors.txt https://mysvnrepo.com.br/svn/myapp/ c:/mygitrepo,它将只创建一个包含所有目录的 GIT 存储库。

基本上我想要为/trunk 中的每个目录创建一个GIT 存储库,这样我就有4 个不同的GIT 存储库:appssiteservicesscripts

我也想只创建 GIT main 分支,忽略其他 SVN 分支。

如何使用git svn 命令执行此操作?

【问题讨论】:

标签: git svn git-svn


【解决方案1】:

我建议先将 SVN 存储库转换为 一个 Git 存储库。

然后在该 Git 存储库上使用 git filter-repo,以便从其中的 4 个子文件夹中提取 4 个存储库。

git filter-repo --path apps
git filter-repo --path site
git filter-repo --path services
git filter-repo --path scripts

作为illustrated here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多