首页 > 解决方案 > 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.

标签: gitmigrationvisual-sourcesafe

解决方案


这是几年前对我有用的解决方案。当我尝试提到的 vss2git 时,它已经在一个周末将我们的 9GB vss 数据库炸毁了 103GB,而没有到达终点。所以我把 TFS 服务器(2010)作为中间人,它起作用了。TFS 2010 可以直接导入 VSS 数据库,我不确定新的。同时,TFS 可以使用 git-tf 或 git-tfs 作为 git 远程。导入后,simplegit tfs clone做了第二部分的业务。所以你去:

  1. 获取支持 VSS 导入的 TFS 版本。这个链接可以帮助你。
  2. 使用向导或命令行来导入您的 VSS 数据库。
  3. 从这里获取 git-tfs
  4. (可选)修复提交日期 - 见下文。
  5. 做这样的事情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 提交的日期)放入查询中。

https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/ms253060(v=vs.120)


推荐阅读