【发布时间】:2021-12-25 17:23:58
【问题描述】:
在Convert a git submodule to a regular directory and preserve the history in the main tree? 中并行相同的问题 但在 git 子树上。
所以我添加了一个 git 子树,它的内容和历史现在在我的主树中, 现在我想把这样的 git 子树变成一个完整的普通目录,删除 git 知道这样的目录属于子树的知识。我该怎么做?
【问题讨论】:
-
一种方法是简单地停止使用
git subtree命令。您想“擦除”哪些方面? -
我不想将子目录移动到单独的 Git 存储库 @phd,我只想让它留在那里。如果我克隆这样的包含子树 repo,克隆的 repo 知道那里有子树。这就是我喜欢抹去的东西,@ LeGEC。
-
我曾经看到一个答案,可以列出一个 repo 拥有的所有 git 子树,但现在在任何地方都找不到。所以,基本上,我问的是如何列出一个 repo 拥有的所有 git 子树,以及如何从这样的列表中删除一个。
-
像这样:stackoverflow.com/a/18339297/7976758 ? (stackoverflow.com/search?q=%5Bgit-subtree%5D+list+subtrees)。 AFAIU 子树在提交消息中标记,因此要删除子树,您需要编辑合并提交消息:stackoverflow.com/a/60401536/7976758
标签: git git-subtree