如何使用git-svn将根目录在不同目录中的svn分支导入到git中? [英] How do I import svn branches rooted in different directories into git using git-svn?

查看:141
本文介绍了如何使用git-svn将根目录在不同目录中的svn分支导入到git中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像下面这样的SVN仓库结构。我们在分支机构下使用了多个级别的各种版本维护分支,以及一个功能分支的目录。



git-svn init似乎可以使用单分支参数,即似乎希望所有的分支机构都在一个位置。

 主干
分支
1.1
1.2.1
1.2.2
1.2
1.2.1
1.2.2
1.2.3
特征
feature1
feature2

关于如何处理这个问题的想法?

谢谢

解决方案

在您的配置文件中,将svn-remotes部分设置为:

  [svn-remotesvn] 
url = svn:// svnserver / repo
fetch = trunk:refs / remotes / trunk
branches = branches / * / *:refs / remotes / *
tags = tags / *:refs / remotes / tags / *

这应该让你抓取嵌套分支。


I have an SVN repository structure like below. We are using multiple levels under branches for various release maintenance branches, plus a directory for feature branches.

git-svn init seems to work with a single --branches argument, i.e. it seems to expect all of the branches to be in a single location.

trunk
branches
  1.1
    1.2.1
    1.2.2
  1.2
    1.2.1
    1.2.2
    1.2.3
  features
    feature1
    feature2

Any ideas on how to handle this?

Thanks

解决方案

In your config file, set the svn-remotes section to something like:

[svn-remote "svn"]
    url = svn://svnserver/repo
    fetch = trunk:refs/remotes/trunk
    branches = branches/*/*:refs/remotes/*
    tags = tags/*:refs/remotes/tags/*

This should let you grab the nested branches.

这篇关于如何使用git-svn将根目录在不同目录中的svn分支导入到git中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆