简体   繁体   English

从 SVN 多仓库迁移到 GIT

[英]Migrating from SVN multi-repo to GIT

I'm total newbie in git-svn bridge and faced a task to migrate from SVN repo to GIT.我是 git-svn bridge 的新手,面临着从 SVN repo 迁移到 GIT 的任务。 SVN structure looks really terribly: SVN 结构看起来真的很糟糕:

root
  base
    server
      core
         branch
         tags
         trunk
      webapp
         branch
         tags
         trunk
       ....
    client
      core
         branch
         tags
         trunk
      ....
    ....
  ....

As a "talented svn migrate-master", I executed git svn clone ..../root and cloned the whole repository.作为“有才华的 svn migrate-master”,我执行了git svn clone ..../root并克隆了整个存储库。 I have no branches visible to GIT:我没有 GIT 可见的分支:

$ git branch -a * master remotes/git-svn

I can easily navigate to root-base-server-core-branch-my-awesome-branch and it looks like regular folder.我可以轻松导航到root-base-server-core-branch-my-awesome-branch ,它看起来像普通文件夹。

How to continue svn2git conversation?如何继续 svn2git 对话? Looks like I should start from scratch but cloning this evil took one week and I don't want to wait again...看起来我应该从头开始,但克隆这个邪恶花了一个星期,我不想再等了......

You have multiple svn projects in that repo.您在该存储库中有多个 svn 项目。 Do you want to combine them in git?你想在 git 中组合它们吗? You may want to look into making a separate git repository for client, core and webapp.您可能需要考虑为客户端、核心和 web 应用程序创建一个单独的 git 存储库。

Look into git svn clone's --branches , it can take multiple wildcards, which you may need with that terrible svn structure.查看 git svn clone 的--branches ,它可以使用多个通配符,您可能需要使用那个可怕的 svn 结构。 Something like --branches=*/*/*/*/branch/*类似于--branches=*/*/*/*/branch/*

You can also use multiple --branches as in --branches=coked/out/path/branch/* --branches=totally/messed/up/path/branches/*您还可以使用多个--branches--branches=coked/out/path/branch/* --branches=totally/messed/up/path/branches/*

From the help:从帮助:

 -T<trunk_subdir>, --trunk=<trunk_subdir>, -t<tags_subdir>, --tags=<tags_subdir>, -b<branches_subdir>, --branches=<branches_subdir>, -s, --stdlayout These are optional command-line options for init. Each of these flags can point to a relative repository path (--tags=project/tags) or a full url (--tags=https://foo.org/project/tags). You can specify more than one --tags and/or --branches options, in case your Subversion repository places tags or branches under multiple paths. The option --stdlayout is a shorthand way of setting trunk,tags,branches as the relative paths, which is the Subversion default. If any of the other options are given as well, they take precedence.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM