简体   繁体   中英

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

Below is my svn repository structure

svnrepo

  • trunk
  • branches
  • tags
  • folder1
  • folder2

I want to have trunk content, folder1 and folder2 in git repositories master branch, how can I achieve this using subgit migration?

gitrepo (master)

  • trunk content
  • folder1
  • folder2

As I understand you don't want branches/ and tags/ in Git. 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.

Update : the question was about translating trunk and a couple of branches into the same Git branch. 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. Note that not skipped directories will still be downloaded from SVN but discarded locally later.

This this is the closest solution to your original question, I don't know anything better.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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