git 中的 CVS 与符号模块等效

发布于 2024-10-12 08:57:40 字数 435 浏览 3 评论 0原文

我正在尝试将我的 cvs 存储库转换为 git,并且在最后一个问题上已经停留了一段时间。

我目前使用 CVS 和符号模块在项目之间共享代码。这些基本上允许您将不同的存储库“别名”为项目中的子目录,这样您就可以更新/提交整个项目,并且它包含远程存储库,就好像它是一个存储库一样。

我已经看到建议子树合并或子模块来执行此操作的线程,参考(svn:externals)。这不起作用,因为:

  • 子树合并显然不允许您轻松地推回/更新外部存储库。

  • 子模块仍然需要您手动推/拉每个子模块。我有大量的子模块,进入每一个子模块来推动我的更改将是乏味的,并且可能会导致遗漏,因为更改会忘记提交。

需要明确的是,我希望有一个 git 存储库,其中包含其他 git 存储库作为子目录,并且能够使用一个命令同时提交/推送/拉取所有这些存储库。

I'm trying to transition my cvs repository to git and have been stuck on this last issue for a while.

I currently use CVS ampersand modules to share code between projets. Those allow you to basically "alias" a different repository as a subdirectory in your project, so you can update / commit the whole project and it's included remote repositories as if it was one repository.

I've seen threads that recommend subtree merges or submodules for doing this, in reference to (svn:externals). This won't work because:

  • subtree merges apparently don't allow you to easily push back / update the external repos.

  • submodules still require you to manually push / pull every submodule. I have a large number of submodules and going into every single one to push my changes would be tedious and could lead to omissions as changes would forget to be committed.

Just to be clear, I would like to have a git repository that contains other git repositories as subdirectories, and be able to commit / push / pull to all of them at the same time with one command.

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

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

发布评论

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

评论(3

临走之时 2024-10-19 08:57:40

这是非常不吉特的。如果它们是单独的项目,则它们属于单独的存储库。

然而,repo 工具被 Android 等项目用来提供上面的一层git 包含大量可能来自不同位置的依赖项目,并允许您通过修订控制(可能按项目转到不同位置)从所有这些项目的本地分支获得工作流程。

这是一个更高的层次,如果您期待确切的 git 体验,您将无法得到它。您可以在任何子项目中使用标准 git 工具,但在顶层,您使用不同的工具进行协调。

That's very much un-git. If they are separate projects, they belong in separate repositories.

However, the repo tool is used by projects such as Android to provide a layer above git that encompasses a large number of dependent projects which may come from different locations and allows you to have a workflow from local branching of all of them through revision control (which may go to different locations by project).

It's a layer up and if you're expecting the exact git experience, you'll not get that. You can use your standard git tools in any subproject, but at the top level, you're using a different tool for the coordination.

予囚 2024-10-19 08:57:40

如果我正确理解你的问题,那么你需要 git 子模块

If I understood your question correctly, then you need git submodules.

手心的海 2024-10-19 08:57:40

我的 git-subtree 项目使得可以在进行子树合并后重新提取更改。许多人发现这是 git-submodule 和子树合并之间最好的选择。

My git-subtree project makes it possible to re-extract changes after doing a subtree merge. Many people find this to be the best of both worlds between git-submodule and subtree merges.

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