将SVN子目录转换为Git [英] Convert SVN Subdirectory to Git

查看:121
本文介绍了将SVN子目录转换为Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想沟通SVN的Git。我目前的SVN存储库设置在主干下( / trunk / projecta / trunk / projectb 等)并在 /tags/projecta-1.0 等分支)。我希望通过使用git-svn将它们从SVN中拉出来,为每个项目创建不同的Git仓库。



我已成功将整个SVN仓库一个当地的Git仓库,但所有的项目现在都存在于同一个Git仓库中。这是否有可能将它们拉开? 解决方案

这很棘手。为了得到一个项目的标签,它的所有标签都必须位于一个公共目录下,但是你的结构中所有的项目都共享一个标签目录。

你可以将/tags/projecta-1.0移动到/tags/projecta/1.0等,然后将项目一次导入到git中:

  git-svn init --trunk = trunk / projecta --tags = tags / projecta ... 

我不知道这是否会按预期工作,所以 在您的存储库副本上执行此操作,而不是原始操作!


I would like to ditch SVN for Git. My current SVN repository setup has projects under trunk (/trunk/projecta, /trunk/projectb, etc. with tags and branches at /tags/projecta-1.0, etc.). I would like to create distinct Git repos for each of these projects by pulling them out of SVN using git-svn.

I've successfully pulled the entire SVN repo down to a local Git repo but all of the projects exist in the same Git repo now. Is it possible to pull them apart at this point?

解决方案

This is tricky. To get, e.g., the tags for a project, all its tags have to be under a common directory, but your structure has all projects sharing a single tag directory.

Perhaps you could move /tags/projecta-1.0 to /tags/projecta/1.0 and so on, and then import projects into git one at a time:

git-svn init --trunk=trunk/projecta --tags=tags/projecta ...

I don't know if this will work as expected, so please do this on a copy of your repository, not the original!

这篇关于将SVN子目录转换为Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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