monopam#
Opam overlay and monorepo manager using git subtrees.
Overview#
Monopam manages synchronization between:
- An opam overlay repository
- Individual git checkouts of packages
- A monorepo using git subtrees
This enables maintaining multiple OCaml packages in a single repository while preserving their individual git histories.
Installation#
opam install monopam
Workflow#
Initialize#
monopam init
Creates configuration and initializes the monorepo structure.
Check Status#
monopam status
Shows synchronization state of all packages, including:
- Pending commits in checkouts
- Uncommitted changes in monorepo
- Remote tracking status
Pull Updates#
monopam pull # Pull all packages
monopam pull <package> # Pull specific package
For each package:
- Clones or fetches the individual checkout
- Adds or pulls the subtree in the monorepo
Push Changes#
monopam push # Push all packages
monopam push <package> # Push specific package
For each package with monorepo changes:
- Splits the subtree commits
- Pushes to the individual checkout
Use --upstream to also push checkouts to their remotes.
Add/Remove Packages#
monopam add <package> # Add package to monorepo
monopam remove <package> # Remove package from monorepo
Directory Structure#
overlay/ # Opam overlay repository
src/ # Individual git checkouts
package-a/
package-b/
monorepo/ # Combined monorepo
package-a/ # Subtree from src/package-a
package-b/ # Subtree from src/package-b
License#
ISC