简体   繁体   English

如何在工作中强制使用CVS的同时使用git游击VC?

[英]How to guerilla VC with git while forced to use CVS at work?

My place of work currently uses CVS. 我的工作地点目前使用CVS。 A git migration is planned but it might be a long time coming. 计划进行git迁移,但可能需要很长时间。 In the mean time I have a one-man project, and have decided to use git for my own personal development. 同时,我有一个单人项目,并决定使用git进行自己的个人开发。 The branching, staged commits, rebasing etc. has been fantastic! 分支,暂存的提交,重新设置等等都很棒! But unfortunately at some point this project, and its history, needs to be imported into CVS, so others can check my progress. 但是不幸的是,这个项目及其历史有时需要导入到CVS中,以便其他人可以检查我的进度。

What's the best way to... 最好的方法是...

  • import the current project (ideally as a set of separate commits/revisions) into CVS 将当前项目(最好是一组单独的提交/修订)导入到CVS中
  • allow repeatable imports of future changes into CVS 允许将将来的更改可重复地导入CVS
  • (bonus question - ideal but not required) merge any CVS changes by other developers back into git (奖金问题-理想但并非必需)将其他开发人员的CVS更改合并回git

Nothing is in CVS at the moment, if it matters. 如果有关系,目前CVS中没有任何内容。 (And if I had my way nothing would ever be in CVS, but I'm stuck with it for now!) Thanks in advance! (如果我能做到的话,CVS将一无所获,但我现在仍然坚持使用它!)预先感谢!

While I have no explicit CVS knowledge I would suggest the following setup. 虽然我没有明确的CVS知识,但我建议进行以下设置。

  • Work\\Project.git <-- git repo Work\\Project.git <-git回购
  • Sync\\Project <-- git clone of master branch in ..\\Work\\Project.git + CVS version control on this folder. Sync\\Project <- ..\\Work\\Project.git中主分支的git克隆+此文件夹上的CVS版本控制。

Than you can do all your git stuff in Project.git and when you want to import into CVS, you go to Sync\\Project and do a git pull to replay the changes in your sync dir (perhaps you need to do a full dir checkout in CVS?). 比您可以在Project.git完成所有git东西时,要导入CVS时,请转到Sync\\Project并执行git pull来重放同步目录中的更改(也许您需要执行完整的目录签出)在CVS中?)。

For the reverse scenario, you might need to work with import branch but I think it would be possible to get the changes from your colleages in the sync folder, but do that import in a new branch, and merge that with your master branch which you pulled from your main git repository. 对于相反的情况,您可能需要使用import分支,但是我认为可以从colleages中的sync文件夹中获取更改,但是可以在新分支中进行导入,并将其与您的master分支合并从您的主要git存储库中提取。 After this merge, you could git push the changes back to your Work\\Project.git . 合并之后,您可以git push更改git push回到Work\\Project.git

In essence, use your sync repository just as if you're another dev. 本质上,就像使用其他开发人员一样使用同步存储库。 You might even let the regular repository pull from your sync (so send a pull request to yourself ;-) ) or use the git send patch mechanism to update your main git repository. 您甚至可以让常规存储库从您的同步中拉出(因此向您自己发送拉出请求;-)),或使用git send patch机制更新主git存储库。

Importing the CVS change set in git, there is a git-cvsimport which should help you with that. 在git中导入CVS更改集,有一个git-cvsimport可以帮助您。

git cvsimportgit cvsexportcommit可以为您提供类似于git svn的工作流程

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

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