This repository contains centrally maintained user documentation that can be reused across multiple repositories via Git submodules.
- Shared Markdown documentation stored in one central location
- A submodule-friendly structure under
docs/ - A controlled update model where consumer repositories choose when to adopt a newer shared docs version
docs/index.md: central entry point for consumersdocs/getting-started.md: onboarding overviewdocs/access.md: baseline access guidancedocs/access-guide.md: expanded access guidance added in the next approved releasedocs/support.md: support model
- Update the shared Markdown files in this repository.
- Commit the change in
shared-docs-demo. - Create a release tag for the approved documentation baseline.
- Consumer repositories can then update their submodule reference when they are ready.
Consumer repositories are expected to embed this repository as a submodule at docs/shared-docs.
Example setup:
git submodule add https://github.com/commutativity/shared-docs-demo.git docs/shared-docs
git commit -m "Add shared documentation submodule"Clone with submodules:
git clone --recurse-submodules <consumer-repo-url>If the repository was cloned without submodules:
git submodule update --init --recursiveTo move a consumer repository to a newer approved shared docs release:
git submodule update --remote docs/shared-docs
git add .gitmodules docs/shared-docs
git commit -m "Update shared docs submodule"Important: the submodule records a concrete commit. Consumers do not update automatically unless someone updates the submodule pointer and commits that change in the consumer repository.
Git submodules fit well when:
- documentation is maintained centrally
- consumers mostly read the content instead of editing it locally
- each repository should choose when to adopt a newer shared baseline
They are less attractive when many consumer repositories need constant parallel edits to the same documentation. In that case, publishing docs from one source or automating sync with CI may be a better fit.