将 git 与 CVS 结合使用的最佳实践
使用 git 与 CVS 存储库交互的最佳实践和技巧是什么?
What are your best practices and tips for using git to interface with a CVS repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我写了一个类似问题的答案 这里。
当您被迫继续将更改推送到中央 CVS 存储库时,这种方法的效果出奇地好。
I wrote up an answer to a similar question here.
This works suprisingly well when you're forced to continue to push changes into a central CVS repository.
我只使用过 Git-CVS 交互来为朋友演示 Git,但它非常简单。
cvsps
。Git cvsimport
使用它来访问 CVS 历史记录。我们发现,对于大型项目,通过将 CVS 存储库的完整副本复制到计算机上并执行
git cvsimport快得多 > 本地:
注意 -p 之后的 -x 非常重要。 这会将 -x 传递给 cvsps。 有关详细信息,请参阅 cvsps 手册页。
I've only worked with Git-CVS interactions to demo Git for a friend, but it was very straightforward.
cvsps
.Git cvsimport
uses this to access CVS history.We found that, for a large project, inital set-up was much faster by taking a full copy of the CVS repo onto your computer, and doing the
git cvsimport
locally:Note that the -x after -p is very important. This passes -x to cvsps. For more information please see the cvsps man page.
我写了我自己的 远程 CVS、本地 Git 工作流程的详细信息
I wrote up the details of my own workflow for remote CVS, local Git
稍微元答案。 如果你被迫使用 git '游击风格',即你的公司一直使用 cvs 进行版本控制,并且你在工作站上使用 git 来让生活更轻松,你可能会考虑做这样的事情;
将此文件命名为“cvs”,并将其包含在真正的 CVS 命令之前的路径。 否则你可以让 git 提交早于 cvs 提交,这没那么有用......
Slightly meta-answer. If you are forced to use git 'guerilla style', i.e. your company is stuck using cvs for the version control and you use git on your workstation to make life easier, you might consider doing something like this;
Calling this file 'cvs' and including it the path before the real CVS command. Otherwise you can have git commits older than the cvs ones, which isn't that useful...
如果上游 100% 采用 CVS(例如 OpenBSD 或其许多子项目,如 mdocml 或 ports-readmes),特别是如果它像 OpenBSD CVS 树一样生锈(例如,有时甚至有历史重写),我发现将底层 CVS/{Entries,Repository,Root} 文件直接提交到我的
git
存储库非常有用。这使得不必拥有多个独立工作区变得非常容易,可以在任何计算机上使用
git
签出,然后使用cvs up
就位,或者cvs diff
生成正确的 CVS 补丁,以便邮寄给上游无 git 的维护人员。If the upstream is 100% in CVS (e.g., OpenBSD, or many of its subprojects like mdocml or ports-readmes), and especially if it's as rusty as the OpenBSD CVS tree is (e.g., occasionally even having history rewrite), I find it quite useful to simply commit the underlying
CVS/{Entries,Repository,Root}
files directly into mygit
repository.This makes it very easy to not have to have multiple independent workspaces, make it possible to checkout with
git
on any machine, and thencvs up
in place, orcvs diff
to generate correct CVS patches for mailing to the git-less maintainers upstream.