简体   繁体   English

如何通过参数将SVN存储库克隆到git?

[英]How to clone SVN repository to git by parameters?

I need to clone SVN repository to git. 我需要将SVN存储库克隆到git。

My SVN repository is very big and I need about 100 revisions back only. 我的SVN信息库很大,我只需要返回大约100个修订版本。

Is there parameters which can help me doing such clone ? 是否有可以帮助我进行此类克隆的参数?

What is the CLI command to clone SVN repository ? 克隆SVN存储库的CLI命令是什么?

See docs for git svn : 请参阅git svn的文档:

-r arg -r arg
--revision arg -修订版arg

Used with the fetch command. 与fetch命令一起使用。

This allows revision ranges for partial/cauterized history to be supported. 这允许支持部分/灼烧历史记录的修订范围。 $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges), $NUMBER:HEAD, and BASE:$NUMBER are all supported. 支持$ NUMBER,$ NUMBER1:$ NUMBER2(数字范围),$ NUMBER:HEAD和BASE:$ NUMBER。

This can allow you to make partial mirrors when running fetch; 这可以让您在运行访存时创建部分镜像。 but is generally not recommended because history will be skipped and lost. 但通常不建议这样做,因为历史记录将被跳过和丢失。

So run 所以跑

git svn init --trunk=trunk_subdir
git fetch -r 100:HEAD # or 100:500 or such

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM