Git/Mercurial 位于本地 cvs 结帐之上
我读过:
,都不适合我的需求。
在工作中,我们使用远程 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 :
- "Best practices for using git with CVS"
- "How to export revision history from mercurial or git to cvs?"
, 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您完全可以直接在 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.
我在工作中正是这样做的,并且我发现以下做法很有帮助:
使任何一个(在我的例子中是
master
)分支始终与 CVS 同步。不要使用此分支进行开发。定期更新此分支以获取团队其他成员所做的更改。如果这些更改与您当前的工作相关,请从您的dev
(或任何其他适当的)分支执行merge master
。当您准备好签入 CVS 时,切换到
master
分支并合并来自相应分支(dev
、feature
)的更改等)。运行测试!您的雇主很可能会保留 CVS 存储库的备份。您必须找到一种方法来备份您的 git 存储库。一种方法是在 Dropbox 文件夹中添加镜像存储库,并使用
post-commit
挂钩在每次提交后更新它。在离开工作之前,切换到
master
分支。我曾经犯过早上在dev
分支上运行CVS up -d
的错误,结果非常困惑。添加脚本以在更新之前自动切换到master
会有所帮助。I have done exactly this at work and I found the following practices helpful:
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 amerge master
from yourdev
(or any other appropriate) branch.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!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.Before you leave work switch to the
master
branch. I once made the mistake of runningCVS up -d
on adev
branch in the morning and ended up quite confused. Adding a script to automatically switch tomaster
before updating helps.