如何提交一个git仓库回购(而不是子模块) [英] How to commit a git repo into a git repo (not submodule)

查看:132
本文介绍了如何提交一个git仓库回购(而不是子模块)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试添加git仓库并将其提交到另一个git仓库时,git有助于将其转换为子模块。如果我想跟踪并提交对外部回购库中嵌套存储库的更改,该怎么办?即我希望外部存储库能够跟踪嵌套仓库工作树中的所有文件以及它的.git目录。

When I try to add and commit a git repository into another git repository, git helpfully makes it into a submodule. What if I want to track and commit changes to that nested repository in the outer repo? I.e. I want the outer repository to track all the files in the nested repo's working tree as well as its .git directory.

这里的用例是我想维护一个我的整个项目目录(其中许多使用git或其他VCS)的git存储库用于版本化备份以及统计信息收集。在外部回购中进行特定的提交应该显示当时所有项目的完整状态,包括承诺,以后可能会被重定名为遗忘。

The use case here is that I want to maintain a git repository of my whole "projects" directory (many of which use git or another VCS) for versioned backups, as well as statistics collection. Going to a particular commit in the outer repo should show me the complete state of all projects at that time, including e.g. commits that may later have been rebased into oblivion.

推荐答案

不可能。

在进一步研究之后,我发现答案很不幸,这是不可能的。 Git硬编码为忽略嵌套的git存储库,不能被告知为它们建立索引。

After researching this further I found the answer is unfortunately that it is not possible. Git is hardcoded to ignore nested git repositories and cannot be told to index them.

备份用例最常见的类似git的建议是 bup ,这对于那个用例来说似乎很好,但似乎无法完成所有这些git可以统计的方式。

The most common git-like suggestion for the backup use case is bup, which seems fine for that use case alone, but can't seem to do all that git can stats-wise.

这篇关于如何提交一个git仓库回购(而不是子模块)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆