Git/Mercurial 位于本地 cvs 结帐之上

发布于 2024-09-18 07:23:49 字数 1067 浏览 11 评论 0原文

我读过:

,都不适合我的需求。

在工作中,我们使用远程 CVS 存储库。对此存储库的访问是通过 eclipse CVS 工具和构建在 eclipse 团队工具之上的内部 eclipse 插件来处理的。这意味着我们无法转向更好的虚拟化系统。

不过,我想在本地计算机上使用 Git(以启用个人分支),以便可以完成以下任务:

在 Git 中创建分支,然后完成并合并回本地主干后,使用 eclipse 提交回 cvs 存储库团队工具等。

我的计划大致如下:

  • 将签出的文件复制到另一个文件夹 [gitRepo]。
  • 在 gitRepo 中的gitRepo 分支中创建主 git 存储库
  • 并进行更改。
  • 提交到 gitRepo
  • 将 gitRepo 复制回签出的文件
  • 与远程 cvs 同步。

我计划在 eclipse 中使用 eGit,但我相信 CVS 和 .git 文件将争夺版本控制的所有权。

有没有任何工具或建议的工作流程可以帮助我管理这个问题?另外,Git 处理 CVS 文件的效果如何。反之亦然,因为我不想让他们互相感染。

前面的链接没有用的原因是它们直接从 git 存储库提交到 cvs 存储库,这让我很担心,因为我不希望意外感染 cvs 存储库。

还应该说的是,GitRepo 中的更改不需要持久化到 CVS 存储库中,例如我不需要看到远程 CVS 中反映的每次对 git 存储库的推送。

~感谢您的阅读。

I have read :

, and neither suit my needs.

At work we use a remote CVS repo. Access to this repo is handled via eclipse CVS tools, and in-house eclipse plugins that are built ontop of team tools for eclipse. This means we can't move to a better vcs.

However I would like to use Git on my local machine (to enable personal branching) such that I can accomplish the following:

Create branches in Git and then once finished and merged back into my local trunk, commit back to the cvs repo using the eclipse team tools etc.

My plan is something along the following lines:

  • Copy the checked out files to another folder [gitRepo].
  • Create a master git repo in gitRepo
  • Branch in gitRepo and make changes.
  • Commit to gitRepo
  • Copy gitRepo back to checked out files
  • Sync with remote cvs.

I was planning on using eGit for eclipse however I believe that the CVS and .git files will compete for ownership of the versioning.

Are there any tools or suggested work flows to help me manage this? Also how well does Git play with CVS files. And vice versa since I don’t want them to infect each other.

The reason the former links are of no use is they commit straight to the cvs repo from the git repo and this worries me as I do not wish to infect the cvs repo by accident.

It should also be said that changes in the GitRepo do not need to persist into the CVS repo, for example I don’t need to see every push to the git repo reflected in the remote CVS.

~Thanks for reading.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

末蓝 2024-09-25 07:23:49

您完全可以直接在 CVS 工作区中创建 git 存储库(就像直接在任何其他 VCS 工具中

确保 git 会忽略任何 .cvs 资源,并确保 CVS 会忽略 .git
任何 Git 提交都不会直接反映在 CVS 中。

唯一的技巧是 Eclipse 只显示 Git 或只显示 CVS 信息和标签装饰。
为此,我将配置两个不同的 Eclipse 透视图,在其中停用一个或另一个 VCS 工具。

You perfectly can create a git repo directly within a CVS workspace (much like directly within any other VCS tool.

Make sure git will ignore any .cvs resources, and make sure CVS will ignore the .git.
Any Git commit won't be directly reflected in CVS.

The only trick is for Eclipse to display only Git or only CVS informations and label decoration.
For that I would configure two different Eclipse perspectives in which I will de-activate one or the other VCS tool.

旧人 2024-09-25 07:23:49

我在工作中正是这样做的,并且我发现以下做法很有帮助:

  1. 使任何一个(在我的例子中是master)分支始终与 CVS 同步。不要使用此分支进行开发。定期更新此分支以获取团队其他成员所做的更改。如果这些更改与您当前的工作相关,请从您的 dev (或任何其他适当的)分支执行 merge master

  2. 当您准备好签入 CVS 时,切换到 master 分支并合并来自相应分支(devfeature)的更改等)。运行测试!

  3. 您的雇主很可能会保留 CVS 存储库的备份。您必须找到一种方法来备份您的 git 存储库。一种方法是在 Dropbox 文件夹中添加镜像存储库,并使用 post-commit 挂钩在每次提交后更新它。

  4. 在离开工作之前,切换到 master 分支。我曾经犯过早上在 dev 分支上运行 CVS up -d 的错误,结果非常困惑。添加脚本以在更新之前自动切换到 master 会有所帮助。

I have done exactly this at work and I found the following practices helpful:

  1. Keep any one (master in my case) branch always in sync with CVS. Do not use this branch for your development. Periodically update this branch to get the changes made by the rest of the team. If these changes are relevant to your current work do a merge master from your dev (or any other appropriate) branch.

  2. When you are ready to check in to CVS switch to the master branch and merge the changes from the appropriate branch (dev, feature etc. as appropriate). Run your tests!

  3. You employer most likely will keep a back up of the CVS repos. You will have to find a way to keep your git repo backed up. One way is to add a mirror repository in a Dropbox folder and use a post-commit hook to update it after each commit.

  4. Before you leave work switch to the master branch. I once made the mistake of running CVS up -d on a dev branch in the morning and ended up quite confused. Adding a script to automatically switch to master before updating helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文