views:

34

answers:

1

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?

+1  A: 
  • submodule is great to:

    • reference one specific commit of another repo (true equivalent of svn external with explicit revision numbers),
    • keep the two histories (the parent repo and the external repo) separate (as in a component-based approach).
  • subtree is great for including the history of one repo into another.

So if those few external repositories have no vocation to end up with all the tags and commit history of the main parent parent, use submodules.
Otherwise, subtree is fine.

VonC