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

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

问题描述

我正在尝试将Visual SourceSafe存储库转换为Git,同时保留确切的版本历史记录.因此,我尝试使用 https://github.com/trevorr/vss2git .它起作用了,但是并没有保留历史.所以我尝试使用TFS作为中间人.我使用了TFS的最新版本及其升级向导,但没有保留历史记录,因此我尝试使用TFS 2013(

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/zh-cn/previous-versions/visualstudio/visual-studio-2013/ms253060(v=vs.120)

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

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