3

To include a few external git repositories in my "main" repository, there are a few options:

  • submodules
  • braid
  • subtree

The first seems to be advised against by basically everybody. The second and third I believe are implementations of the subtree pattern.

Is one better? Which should I use? Why? How can I choose between them?

4

1 回答 1

4
  • 子模块非常适合:

    • 引用另一个 repo 的一个特定提交(真正等效于 svn external,带有明确的修订号),
    • 将两个历史记录(父仓库和外部仓库)分开(如在基于组件的方法中)。
  • 子树非常适合将一个回购的历史包含到另一个回购中。

因此,如果这几个外部存储库没有权限最终获得主要父级父级的所有标签和提交历史记录,请使用子模块。
否则,子树很好。

于 2010-10-02T19:04:13.727 回答