简体   繁体   English

确定cvs2git如何转换CVS树

[英]Determining how cvs2git converted CVS trees

I successfully converted and imported into git an eight-year old CVS master tree which contains individual CVS projects. 我成功转换并导入了一个八年前的CVS主树,它包含了个人的CVS项目。 I am trying to figure out what the cvs2git conversion did to the individual CVS repositories. 我试图找出cvs2git转换对单个CVS存储库的作用。

Fortunately, I still have the master CVS tree and have not deployed anything, so I can do this again. 幸运的是,我仍然拥有主CVS树并且没有部署任何东西,所以我可以再次这样做。 I'm looking for git commands that will let me explore what I converted, so I can tell if I should have converted each CVS repository separately. 我正在寻找git命令,它可以让我探索我转换的内容,因此我可以判断我是否应该单独转换每个CVS存储库。

You can verify what cvs2git did by issuing git log against one of your subprojects: 您可以通过针对您的一个子项目发出git log来验证cvs2git

git log -- <directory>

If that command returns a full history, cvs2git merged all your subprojects into one. 如果该命令返回完整历史记录,则cvs2git将所有子项目合并为一个。 Based on your comments this looks to be the case. 根据您的意见,情况就是如此。

You've now got a choice: Fracture the repo or keep it combined? 您现在可以选择:破坏回购或将其合并? This isn't always a clear-cut decision, and the motivations for fracturing a repo in CVS are different than they are in git. 这并不总是一个明确的决定,并且在CVS中破解回购的动机与它们在git中的不同。

I recommend trying your new git repository for a couple of weeks, without fracturing it into submodules, subtrees, or nested repositories. 我建议您尝试使用新的git存储库几周,而不要将其分解为子模块,子树或嵌套存储库。 This will get you comfortable with common git commands, and let you try out some great git features like git bisect , which are more difficult to use when you nest projects. 这将使您熟悉常见的git命令,并让您尝试一些很棒的git功能,如git bisect ,在嵌套项目时更难以使用。 Additionally, I suspect you'll find branching and particularly merging to be stupidly easy in comparison to CVS. 另外,我怀疑你会发现分支,特别是合并,与CVS相比,变得非常容易。 It might be the case that you don't need to fracture the repository at all. 可能是您根本不需要破坏存储库的情况。

If you decide you want to do so, give some other answers on the topic a read. 如果您决定要这样做,请阅读主题上给出一些其他答案 Splitting the repo itself is easy. 拆分回购本身很容易。 Here's a simple tutorial from github. 这是github的简单教程 A quick google search will turn up quite a few more. 快速谷歌搜索将会出现更多。

I just converted an eight years old CVS repository using cvs2git. 我刚刚使用cvs2git转换了一个八年前的CVS存储库。 I found that using "gitk --all" in the resulting repositories let me have a good grasp as to how the convertion did. 我发现在生成的存储库中使用“gitk --all”可以让我很好地掌握转换的方式。 So, I'd suggest this command to you. 所以,我建议给你这个命令。

However, I didn't convert the whole CVS repo into a single Git repo. 但是,我没有将整个CVS repo转换为单个Git仓库。 As your, my CVS repo had, in fact, several different projects inside it. 事实上,我的CVS回购中有几个不同的项目。 Each project was inside a different directory. 每个项目都在不同的目录中。 So, I performed several conversions, one for each project. 所以,我进行了几次转换,每个项目一次。 You simply point cvs2git to the particular subdirectory of the CVS repo that you are interested in. It will convert the directories history into a Git repository. 您只需将cvs2git指向您感兴趣的CVS仓库的特定子目录。它会将目录历史记录转换为Git存储库。 So, I ended up with several Git repos, one for each project, which gave me much better histories for each repository. 所以,我最终得到了几个Git repos,每个项目一个,这为每个存储库提供了更好的历史记录。 I'd suggest you try this approach too. 我建议你也尝试这种方法。

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

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