简体   繁体   English

CVS 到 Centos8 中的 GIT

[英]CVS to GIT in Centos8

cvsimport is missing in Centos8. Centos8 中缺少 cvsimport。 Unable to install.无法安装。 Now I tried to use fast-import.现在我尝试使用快速导入。 Most of the repos it is okay but it fails with some repo which has binary files.大多数存储库都可以,但是由于某些包含二进制文件的存储库而失败。 I think there is a bug in cvs-fast-export我认为 cvs-fast-export 有一个错误

$ cat ../repoexport.fi|git fast-import fatal: Unsupported command:
mark :11 fast-import: dumping crash report to
.git/fast_import_crash_19654 Unpacking objects: 100% (1/1), 21 bytes |21.00 KiB/s, done.

This is from the crash report这是来自崩溃报告

Most Recent Commands Before Crash
---------------------------------
  blob
  mark :1
  data 30790
  blob
  mark :2
  data 7060
  blob
  mark :3
  data 30650
  blob
  mark :4
  data 516323
  blob
  mark :5
  data 355588
  blob
  mark :6
  data 497407
  blob
  mark :7
  data 4397056
  blob
  mark :8
  data 807
  blob
  mark :9
  data 299008
  blob
  mark :10
  data 196608
  blob
  mark :11
* blob

Any solution to convert cvs to git?将 cvs 转换为 git 的任何解决方案?

Posting solution based on comment exchange above in original question在原始问题中基于上述评论交换发布解决方案

I suggest trying cvs2git .我建议尝试cvs2git

@RamananT says @RamananT 说

I Tried and unfortunately cvs2git also failed with this error ERROR: The command 'cvs -Q -f -d:local:/home/user/path/to/cvs/repo/proj co -r1.1.1.2.1 -p -kb scripts/additions/320_str.20070501-001101.sql' failed with exit status=-9 and no output.我试过了,不幸的是 cvs2git 也因为这个错误而失败ERROR: The command 'cvs -Q -f -d:local:/home/user/path/to/cvs/repo/proj co -r1.1.1.2.1 -p -kb scripts/additions/320_str.20070501-001101.sql'失败,退出状态=-9,没有 output。

I then suggested然后我建议

You could try that command yourself to see if the ,v file is somehow corrupted.您可以自己尝试该命令以查看,v文件是否以某种方式损坏。 The stored sql file it is a text file, but the .sq,v file is in RCS format and you would not be able to tell by inspection if it was corrupted or not.存储的 sql 文件是文本文件,但.sq,v文件是 RCS 格式,您无法通过检查来判断它是否已损坏。 But you could fairly easily但你可以相当容易

  • run the cvs command that cvs2git says fails and see if it fails for you when run manually.运行cvs2git说失败的cvs命令,看看手动运行时它是否会失败。 Or或者
  • you could make a copy of the repo, remove that one file, and try cvs2git on that.你可以制作一个 repo 的副本,删除那个文件,然后尝试cvs2git That would also show you if that particular file is indeed a problem.如果该特定文件确实存在问题,这也会告诉您。

Thanks @mort, that made wonders.谢谢@mort,这创造了奇迹。 If it is an answer I would accept this solution.如果这是一个答案,我会接受这个解决方案。 The issue is just on that file.问题就在那个文件上。 I didn't investigate the issue but just deleted and carried on我没有调查这个问题,只是删除并继续

Thanks to @Mort I am able to solve the issue and successfully import CVS in to GIT (BitBucket).感谢@Mort,我能够解决问题并将 CVS 成功导入 GIT (BitBucket)。 To help anyone out there here is the exact steps.为了帮助那里的任何人,这里有确切的步骤。 This worked on Centos 8.这适用于 Centos 8。

  1. Copy the cvs repo that need to be migrated复制需要迁移的cvs repo

    scp -r cvs_repo_server:/path/to/cvs/repo/project1./ scp -r cvs_repo_server:/path/to/cvs/repo/project1./

  2. create CVSROOT to satisfy cvs2git tool创建 CVSROOT 以满足 cvs2git 工具

    mkdir project1/CVSROOT mkdir project1/CVSROOT

  3. delete problematic files that fails.删除失败的有问题的文件。 How you find out is running the cvs2git in further below steps.你如何发现在下面的步骤中运行 cvs2git。 It is trial and error这是反复试验

    rm <project1/path/to/cvs/problematic/file,v> rm <project1/path/to/cvs/problematic/file,v>

  4. clone and run cvs2git克隆并运行 cvs2git

    git clone https://github.com/mhagger/cvs2svn.git git 克隆https://github.com/mhagger/cvs2svn.git

    cd cvs2svn cd cvs2svn

    ./cvs2git --blobfile=blob.dat --dumpfile=dump.dat --username=cvs2git --fallback-encoding utf-8../project1/ ./cvs2git --blobfile=blob.dat --dumpfile=dump.dat --username=cvs2git --fallback-encoding utf-8../project1/

    cd..光盘..

  5. create repo in bitbucket and then clone empty repo在 bitbucket 中创建仓库,然后克隆空仓库

    git clone bitbucket/url/mig_project1 git 克隆 bitbucket/url/mig_project1

  6. cd in to cloned repo cd 到克隆的 repo

    cd mig_project1 cd mig_project1

  7. import into git and push it导入 git 并推送

    cat../cvs2svn/blob.dat../cvs2svn/dump.dat | cat../cvs2svn/blob.dat../cvs2svn/dump.dat | git fast-import git 快速进口

    git push --all git 推--全部

    git push --tags git 推送 --tags

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

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