简体   繁体   English

subgit-svn的主干和根文件夹将合并到git的主文件夹中

[英]subgit - svn's trunk and root folder to be combined in git's master folder

Below is my svn repository structure 下面是我的SVN存储库结构

svnrepo 斯文雷波

  • trunk 树干
  • branches 分行
  • tags 标签
  • folder1 资料夹1
  • folder2 资料夹2

I want to have trunk content, folder1 and folder2 in git repositories master branch, how can I achieve this using subgit migration? 我想在git仓库master分支中包含trunk内容, folder1folder2 ,如何使用subgit迁移实现这subgit

gitrepo (master) gitrepo(管理员)

  • trunk content 行李箱内容
  • folder1 资料夹1
  • folder2 资料夹2

As I understand you don't want branches/ and tags/ in Git. 据我了解,您不需要Git中的branch /和tags /。 In this case you can use the following configuration: 在这种情况下,您可以使用以下配置:

trunk = trunk:refs/heads/master
branches = folder1:refs/heads/folder1
branches = folder2:refs/heads/folder2

You can find more information about trunk/branches/tags/shelves options in branches mapping article. 您可以在分支映射文章中找到有关主干/分支/标签/架子选项的更多信息。 Optionally you can add shelves=shelves/*:refs/shelves/* option if you need bi-directional translation and want to translate every single Git commit to a separate revision in case of self-merges in branches. 如果需要双向转换,并且希望将每个Git提交转换为单独的修订版本(如果自合并在分支中),则可以选择添加[ shelves=shelves/*:refs/shelves/*选项。

Update : the question was about translating trunk and a couple of branches into the same Git branch. 更新 :问题是关于将主干和几个分支转换为同一个Git分支。 I can only propose the following approach: 我只能提出以下方法:

trunk = :refs/heads/master
includePath = /trunk
includePath = /folder1
includePath = /folder2

It will translate the project root into refs/heads/master but skip everything except these 3 directories. 它将项目根目录转换为refs / heads / master,但跳过这3个目录之外的所有内容。 Note that not skipped directories will still be downloaded from SVN but discarded locally later. 请注意,未跳过的目录仍会从SVN下载,但稍后会在本地丢弃。

This this is the closest solution to your original question, I don't know anything better. 这是最接近您的原始问题的解决方案,我知道更好。

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

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