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

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

问题描述

我有一个如下所示的 SVN 存储库结构.我们在各个版本维护分支的分支下使用多个级别,并为功能分支使用一个目录.

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 似乎可以使用单个 --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?

谢谢

推荐答案

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

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天全站免登陆