簡體   English   中英

如何克隆非標准的svn repo到git?

[英]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 .

兩者都無法正確克隆branch1branch2 請幫忙。

svn-root
├── branch1
├── branch2
├── branches
│   ├── branch3
│   └── branch4
└── trunk

GitMinutes第20集中提到的一個有趣的工具是SubGit ,它是Atalssian Stash的插件(它不是免費的,但你可以免費試用)。
您可以在“ GitMinutes#22:Alexander Kitaev關於SubGit ”中了解更多有關SubGit的信息

它旨在管理非傳統的svn repo布局。

http://subgit.com/img/stash/105_repository_layout.png

德米特里·帕夫連科 評論道

你應該進入“分支”字段:

*:refs/heads/*;branches/*:refs/heads/branches/* 
# instead of 
branches/* 

在這種情況下, branch1將被轉換為refs/heads/branch1
branch3 --- to refs/heads/branches/branch3

或者,如果您具有有限數量的頂級分支,則可以顯式枚舉它們:

branch1:refs/heads/branch1;
branch2:refs/heads/branch2;
branches/*:refs/heads/bra‌​nches/*

我想到兩個選擇:

  • 首先清理SVN倉庫(在分支下方移動分支,根據標准布局移動分支)。
  • 使用標准布局結帳,稍后添加遠程分支引用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM