git-svn如何与svn版本库一起改变布局? [英] How does git-svn behave with svn repositories that have changed layout?

查看:120
本文介绍了git-svn如何与svn版本库一起改变布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题类似于这一个这一个,但情景稍微复杂一些。



几年前,我开始使用私有svn存储库(我主要用于共享配置文件之类的各种机器之间)。我并不太在意仓库的布局(分支,去哪等),所以它随着时间的推移发生了很大的变化。这当然是一个错误,但现在已经太晚了。最近,我已经将它迁移到更标准的svn trunk / branches / tags布局,主要是使用svn move命令,但是旧的历史记录当然仍然存在于存储库中(坦率地说,这有点乱) 。



现在我想将其永久转换为git存储库。我尝试过使用git-svn,但它似乎只处理遵循一致的trunk / branch / tag约定的情况(是的,你可以提供替代名称,但每个名称只有一个出现)。我的存储库的很多历史记录都在存储库的根目录中有效,例如,标记/和分支/作为子目录。



什么是处理所有这一切的最佳方法?理想情况下,我希望git仓库最终能够以某种方式访问​​所有历史记录,即使分支和标签在git中没有正确表示为一流概念。



更具体地说,svn-git如何处理它所提供的trunk / branches / tags子目录之外的文件?我的观察到目前为止,它有时会错过它们(绝对不行),有时候它们会将它们添加到新的存储库中。



任何想法都不胜感激。根据我的经验,处理这个问题的唯一方法是随时跟踪资料库的位置,并制作一个单独的git-svn-克隆每个时期项目仍然在一个位置。



在您为不同阶段创建存储库后(或至少早在您可能被打扰的时候),您可以将存储库移植到一起。



我创建了一个截屏视频,演示了这种技术:

http://blog.tfnico.com/2010 /10/gitsvn-6-grafting-together-svn-history.html


This question is similar to this one and this one, but the scenario is slightly more complex.

I started out a few years ago with a private svn repository (which I use mainly for shared config files and the like between various machines). I wasn't too careful with the layout of the repository (where branches, go, etc.), so it changed quite a lot over time. This was, of course, a mistake, but it's too late now. More recently, I've migrated it to a more standard svn trunk/branches/tags layout, mainly with svn move commands, but of course the old history is still present in the repository (and is, frankly, a bit of a mess).

I'd now like to convert this permanently to a git repository. I've tried using git-svn, but it only seems to handle situations where a consistent trunk/branch/tag convention has been followed (yes, you can provide alternative names, but only one for each, it appears). Quite a lot of the history of my repository has trunk effectively in the root of the repository, for example, with tags/ and branches/ as sub-dirs.

What's the best way to handle all of this? Ideally I'd like the git repository I end up with to at least have all the history accessible in some way, even if the branches and tags aren't properly represented as first-class concepts in git.

More specifically, how will svn-git handle files outside the trunk/branches/tags subdirectories it's provided with? My observations so far are that it misses them out sometimes (definitely not OK), and other times adds them to the new repository.

Any thoughts would be appreciated.

解决方案

In my experience, the only way to handle this is to track the repository's location throughout time, and make a separate git-svn-clone for each period the project remained in one location.

After you've created the repositories for different stages in time (or at least as far back as you can be bothered), you can graft the repositories together.

I've created a screencast demonstrating this technique here:

http://blog.tfnico.com/2010/10/gitsvn-6-grafting-together-svn-history.html

这篇关于git-svn如何与svn版本库一起改变布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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