A structured repository for managing third-party open source projects using Git submodules.
.
├── docs/ # Documentation (auto-generated / manual)
├── scripts/ # Submodule management scripts
├── third_party/ # Third-party open source projects (submodules)
└── tools/ # Utility scripts
git clone --recurse-submodules <repo_url>
cd open-source-collectionbash scripts/bootstrap.shAll maintenance operations are handled via scripts in scripts/.
Purpose: Initialize and fetch all submodules after clone.
bash scripts/bootstrap.shWhat it does:
- Sync
.gitmodulesconfiguration - Initialize submodules
- Fetch all submodule content recursively
Purpose: Update all submodules to the latest upstream commits.
bash scripts/update_submodules.shWhat it does:
- Sync submodule configuration
- Pull latest changes from each submodule remote
- Show updated submodule status
After running:
git status
git diff --submodule
git add .
git commit -m "chore: update submodules"Purpose: Sync local submodule config with .gitmodules.
bash scripts/sync_submodules.shUse case:
- After modifying
.gitmodules - When submodule URLs change
Purpose: Generate project inventory automatically.
bash scripts/generate_projects_md.shOutput:
docs/PROJECTS.md
Content includes:
- Submodule name
- Path
- Remote URL
Purpose: Check repository health.
bash tools/repo_health_check.shChecks:
.gitmodulesexistencethird_party/structure- Git status
- Submodule status
git submodule add <repo_url> third_party/<name>
bash scripts/generate_projects_md.sh
git add .
git commit -m "feat: add <name> submodule"bash scripts/update_submodules.sh
git status
git diff --submodule
git add .
git commit -m "chore: update submodules"
git push- All third-party projects must be under
third_party/ - Do not manually move submodules using
mv - Do not modify third-party code directly
- Always review submodule updates before commit
Caused by:
- Moving directories manually
- Re-adding without cleanup
Fix:
git submodule deinit -f .
rm -rf .git/modules/*Then re-add cleanly.
See:
docs/PROJECTS.md
Generated via:
bash scripts/generate_projects_md.shThis repository:
- Tracks upstream projects without modifying them
- Uses submodules for reproducibility
- Separates third-party code from local scripts/tools
- Provides automation for maintenance
This repository contains only:
- Scripts
- Metadata
Each submodule retains its original license.