Git-subrepo
To store multiple related repositories in github closely together. I use the solution from
ingydotnet/git-subrepo
Comparison of other git module options
Feature | Git Submodule | Custom git-subrepo | Git Subtree |
---|---|---|---|
Code sharing | As subdirectories | As subdirectories | As subdirectories |
Dependency management | Yes | Yes | Yes |
Separate history | Yes | Yes | No (merged history) |
Ease of use | Complex | Moderate | Moderate |
Requires additional setup | Yes | Yes | No |
Updates | Manual update required | Automated updates possible | Manual update required |
Storage | Reference to external repo | Full copy of external repo | Full copy of external repo |
Workflow | Decentralized | Decentralized | Decentralized |
Learning curve | Steep | Moderate | Moderate |
Compatibility | Native Git feature | Requires installation | Native Git feature (since 1.7.11) |
Key Differences
Git Submodule
- Maintains separate repository references
- Lightweight but complex to manage
- Requires explicit version pinning
- Minimal storage overhead
Custom git-subrepo
- More flexible update mechanism
- Easier to synchronize changes
- Potentially more user-friendly
- Requires additional tooling
Git Subtree
- Simplest implementation
- Merges entire repository history
- No additional tooling required
- Easier for linear project structures
Recommendation depends on specific project complexity and team workflow preferences.