![](/img/trans.png)
[英]How to properly initialize git-svn clone of a repository with nonstandard layout?
[英]How to clone a nonstandard svn repo to git?
我嘗試將svn repo克隆到git,但是一些分支在svn根目錄中,如下所示。
我試過了
$ git clone svn://url/svn-root -T trunk -b branches -b branch1 -b branch2
和
$ git clone svn://url/svn-root -T trunk -b branches -b .
兩者都無法正確克隆branch1
和branch2
。 請幫忙。
svn-root
├── branch1
├── branch2
├── branches
│ ├── branch3
│ └── branch4
└── trunk
在GitMinutes第20集中提到的一個有趣的工具是SubGit ,它是Atalssian Stash的插件(它不是免費的,但你可以免費試用)。
您可以在“ GitMinutes#22:Alexander Kitaev關於SubGit ”中了解更多有關SubGit的信息 。
它旨在管理非傳統的svn repo布局。
你應該進入“分支”字段:
*:refs/heads/*;branches/*:refs/heads/branches/*
# instead of
branches/*
在這種情況下,
branch1
將被轉換為refs/heads/branch1
,
branch3
--- torefs/heads/branches/branch3
。或者,如果您具有有限數量的頂級分支,則可以顯式枚舉它們:
branch1:refs/heads/branch1;
branch2:refs/heads/branch2;
branches/*:refs/heads/branches/*
我想到兩個選擇:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.