···11+# Monorepo Development Guide
22+33+This is a monorepo managed by `monopam`. Each subdirectory is a git subtree
44+from a separate upstream repository.
55+66+## Making Changes
77+88+1. Edit code in any subdirectory as normal
99+2. Build and test: `opam exec -- dune build` and `opam exec -- dune test`
1010+3. Commit your changes to this monorepo with git
1111+1212+## Exporting Changes to Upstream
1313+1414+After committing changes here, they must be exported to the individual
1515+repositories before they can be pushed upstream:
1616+1717+```
1818+monopam push
1919+```
2020+2121+This extracts your commits into the individual checkouts in `../src/`.
2222+You then review and push each one manually:
2323+2424+```
2525+cd ../src/<repo-name>
2626+git log --oneline -5 # review the changes
2727+git push origin main # push to upstream
2828+```
2929+3030+## Pulling Updates from Upstream
3131+3232+To fetch the latest changes from all upstream repositories:
3333+3434+```
3535+monopam pull
3636+```
3737+3838+This updates both the checkouts and merges changes into this monorepo.
3939+4040+## Important Notes
4141+4242+- **Always commit before push**: `monopam push` only exports committed changes
4343+- **Check status first**: Run `monopam status` to see which repos have changes
4444+- **One repo per directory**: Each subdirectory maps to exactly one git remote
4545+- **Shared repos**: Multiple opam packages may live in the same subdirectory
4646+ if they share an upstream repository
4747+4848+## Troubleshooting
4949+5050+If `monopam push` fails with "dirty state", you have uncommitted changes.
5151+Commit or stash them first.
5252+5353+If merge conflicts occur during `monopam pull`, resolve them in this monorepo,
5454+commit, then the next pull will succeed.