git - Migrating from VSS to Git while keeping the history
问题描述
I'm trying to convert a Visual SourceSafe Repository to Git while keeping the exact version history. So I've tried using https://github.com/trevorr/vss2git. It worked, but it didn't keep the history. So I tried using TFS as a middleman. I used The latest version of TFS and its upgrade wizard but it didn't keep the history, so I tried with TFS 2013 (How to migrate VSS 2005 to TFS 2015?) and its upgrade wizard, but still no history. I'm pretty desperate now, and I don't know where the problem lies, as I even analyzed my VSS repository, and no errors were found. I've read that I could also try using SVN as the middleman, so I'll do that, but I'm skeptic.
解决方案
这是几年前对我有用的解决方案。当我尝试提到的 vss2git 时,它已经在一个周末将我们的 9GB vss 数据库炸毁了 103GB,而没有到达终点。所以我把 TFS 服务器(2010)作为中间人,它起作用了。TFS 2010 可以直接导入 VSS 数据库,我不确定新的。同时,TFS 可以使用 git-tf 或 git-tfs 作为 git 远程。导入后,simplegit tfs clone
做了第二部分的业务。所以你去:
- 获取支持 VSS 导入的 TFS 版本。这个链接可以帮助你。
- 使用向导或命令行来导入您的 VSS 数据库。
- 从这里获取 git-tfs
- (可选)修复提交日期 - 见下文。
- 做这样的事情
git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project
我能记得的唯一怪癖是 TFS 已将所有提交的日期设置为当前日期,并将原始 vss 日期放入评论中。我已经直接在 TFS 的 SQLEXPRESS 数据库中修复了这个问题,如下所示:
UPDATE tbl_ChangeSet
SET CreationDate = CONVERT (datetime, Substring(Comment,2,19), 104)
Where CreationDate > '2014-01-28' AND Comment LIKE '{%'
请将您自己的日期(最后一次 VSS 提交的日期)放入查询中。
推荐阅读
- ios - 在 iOS 中,对具有 2 个复合键的表的 Dexie 更新变得非常慢
- sql - DB2 中具有位/十六进制混淆的字符
- java - Java 中的位操作 - 基于位值有条件地切换位?
- winapi - MFC:滚动条抓手有一个闪烁的光标?
- python - 如何写一个方程的组合
- laravel - Laravel 刷新特定播种器
- java - 使用 Spring Integration 接收邮件?
- sql-server - 如何替换 yyyymmdd 以选择表名称的最新月份结束日期
- python - 如何使用 python 获取多个 JSON 字符串以呈现为数据框?
- python - 从包含列表的 Python 字典中替换 SQL“in”语句中的方括号和引号