git svn克隆SVN存储库的单个目录 [英] git svn clone of a single directory of SVN repository

查看:796
本文介绍了git svn克隆SVN存储库的单个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 git svn 将SVN存储库的单个目录克隆到Git存储库中。



如果我使用 git svn clone svn + ssh:// path / to / repo / trunk / directory ,我得到一个没有分支的Git仓库,如果我使用 git svn --stdlayout svn + ssh:// path / to / repo / trunk / directory code>,我得到一个空的Git回购。以下是该命令的输出:

 在/directory/.git/中初始化空的Git存储库
使用更高版本URL级别:svn + ssh:// path / to / repo / trunk / directory => svn + ssh:// path / to / repo
W:忽略来自SVN的错误,路径可能不存在:(160013):Filesystem没有项目:File not found:revision 100,path'/ trunk / directory '
W:不要对上述信息感到担忧git-svn只是在积极地搜索旧的历史。
这可能需要一段时间才能在大型资源库

我已经阅读了解决这个问题的方法上面是添加版本范围像 -r 1000:HEAD ,这仍然会产生一个空的回购。输出是:

$ p $ 在/directory/.git/中初始化空的Git存储库
使用更高级别的URL:svn + ssh:// path / to / repo / trunk / directory => svn + ssh:// path / to / repo

关于如何克隆一个子目录的任何想法SVN仓库使用git-svn仍然抓住所有的分支机构&标签来源SVN respository?

解决方案

你不需要标准布局,你需要这样的东西:

  git svn clone svn + ssh:// path / to / repo / --trunk = trunk / directory --branches = branches / * /目录--tags = tags / * /目录


I am attempting to use git svn to clone a single directory of a SVN repository into a Git repository.

If I use git svn clone svn+ssh://path/to/repo/trunk/directory, I get a Git repo without branches that mirror the branches in the source SVN repo.

If I use git svn --stdlayout svn+ssh://path/to/repo/trunk/directory, I get an empty Git repo. The following is the output of the command:

Initialized empty Git repository in /directory/.git/
Using higher level of URL: svn+ssh://path/to/repo/trunk/directory => svn+ssh://path/to/repo
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: File not found: revision 100, path '/trunk/directory'
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories

I had read that the way to fix the above was to add a revision range like -r 1000:HEAD, this still produces an empty repo. The output is:

Initialized empty Git repository in /directory/.git/
Using higher level of URL: svn+ssh://path/to/repo/trunk/directory => svn+ssh://path/to/repo

Any ideas on how to clone a subdirectory of an SVN repository using git-svn that still grabs all of the branches & tags from the source SVN respository?

解决方案

You don't want standard layout, you want something like this:

git svn clone svn+ssh://path/to/repo/ --trunk=trunk/directory --branches=branches/*/directory --tags=tags/*/directory

这篇关于git svn克隆SVN存储库的单个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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