简体   繁体   English

当SVN储存库确实包含多个“储存库”时,如何使用git-svn?

[英]How to use git-svn when SVN repository really contains multiple “repositories”?

Supposed I have an umbrella SVN repo, "CompanyName". 假设我有一个完整的SVN存储库“ CompanyName”。 Within this repo, there are many projects, "Project1", "Project2", ..., "ProjectN". 在此仓库中,有许多项目,“ Project1”,“ Project2”,...,“ ProjectN”。 Eg the SVN repo houses multiple projects instead of a single repo per project. 例如,SVN存储库包含多个项目,而不是每个项目包含一个存储库。 I want to "move" Project1 to Git, so I tried to do this: 我想将Project1“移动”到Git,所以我尝试这样做:

git svn clone --no-metadata --authors-file=users.txt --prefix=origin/ --trunk=Trunk --branches=Branches svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName/Internal/Project1/

To which, git-svn responds: git-svn对此响应:

Initialized empty Git repository in c:/Projects/CompanyName/Internal/Project1/.git/
Using higher level of URL: svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName/Internal/Project1 => svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName

Note that git has correctly moved up to the root of the repository, although I want it to focus on the path I specified. 请注意,尽管我希望git专注于指定的路径,但git已经正确地移至了存储库的根目录。 Moving into Project1 , running git branch -r gives me no output, so this did not appear to work. 进入Project1 ,运行git branch -r没有给出任何输出,因此这似乎没有用。

这是通过对git svn使用--no-minimize-url选项解决的:

git svn clone --no-metadata --authors-file=users.txt --prefix=origin/ --trunk=Trunk --branches=Branches --no-minimize-url svn+ssh://me@svn.dev.companyname.biz/svn/CompanyName/Internal/Project1/

I was getting similar error. 我收到类似的错误。 I resolved it by using --no-minimize-url 我通过使用--no-minimize-url解决了

This is my full URL , the -r specifies from which version I want to take and after that I did git snv rebase 这是我的完整URL,-r指定我要从哪个版本获取,之后执行git snv rebase

git svn clone -r 15846 svnurl -T trunk -A ../authors.txt gitreponame --no-minimize-url git svn clone -r 15846 svnurl -T trunk -A ../authors.txt gitreponame --no-minimize-url

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

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