从 VSS 迁移到 Git,同时保留历史记录 [英] Migrating from VSS to Git while keeping the history

查看:24
本文介绍了从 VSS 迁移到 Git,同时保留历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Visual SourceSafe 存储库转换为 Git,同时保留准确的版本历史记录.所以我尝试使用 https://github.com/trevorr/vss2git.它有效,但它没有保留历史.所以我尝试使用 TFS 作为中间人.我使用了最新版本的 TFS 及其升级向导,但它没有保留历史记录,所以我尝试使用 TFS 2013 (如何将 VSS 2005 迁移到 TFS 2015?) 及其升级向导,但仍然没有历史记录.我现在很绝望,我不知道问题出在哪里,因为我什至分析了我的 VSS 存储库,没有发现任何错误.我读到我也可以尝试使用 SVN 作为中间人,所以我会这样做,但我持怀疑态度.

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 远程.导入之后,简单的git tfs clone就完成了第二部分的业务.所以给你:

Here is the solution which worked for me a couple years ago. When I tried the mentioned vss2git, it has blown our 9GB vss database in 103GB over a weekend without reaching the end. So I took the TFS server (2010) as middleman and it worked. The TFS 2010 could import VSS database directly, I am not sure about newer ones. Simultaneously, the TFS can serve as a git remote using git-tf, or git-tfs for example. After the import, simple git tfs clone has done the second part of the business. So here you go:

  1. 获取支持 VSS 导入的 TFS 版本.此链接 可以帮助你.
  2. 使用向导或命令行导入您的 VSS 数据库.
  3. 这里
  4. 获取 git-tfs
  5. (可选)修正提交日期 - 见下文.
  6. 做这样的事情 git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project
  1. Get a TFS version capable of VSS import. This link can help you.
  2. Use the wizard, or command line to import your VSS database.
  3. Get git-tfs from here
  4. (Optionally) fix the commit dates - see below.
  5. Do something like this git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project

我记得的唯一怪癖是 TFS 已将所有提交的日期设置为当前日期,并将原始 vss 日期放入评论中.我已经直接在 TFS 的 SQLEXPRESS 数据库中修复了这个问题,如下所示:

The only quirk I can remember was that the TFS has set the date of all commits to current date and has put the original vss dates into the comments. I have fixed this directly in the SQLEXPRESS database of the TFS like this:

UPDATE tbl_ChangeSet 
SET CreationDate =  CONVERT (datetime, Substring(Comment,2,19), 104)
Where CreationDate > '2014-01-28' AND Comment LIKE '{%'

请在查询中输入您自己的(最后一次 VSS 提交的)日期.

Please put your own date (of the last VSS comit) into the query.

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

这篇关于从 VSS 迁移到 Git,同时保留历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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