A big home for small repos
monorepo
groups multiple (sub)repos into one big repo and supports bidirectional sync (push
and pull
).
- Start with a new (empty) repo to be your monorepo
- Add a
monorepo.yml
(see _examples/simple) - Run
monorepo pull
- This will pull the files from the subrepos
- Creaate
monorepo.lock
with the specific SHAs pulled in
- Commit the monorepo (e.g:
git commit -am "Initial pull"
)
You can use a CI system like Travis to automate syncing between your monorepo and sub repos.
git clone https://github.com/org/bigrepo
cd bigrepo
monorepo pull
git add .
git commit -am "Update"
git push
cd bigrepo
monorepo push
❯ monorepo --help
NAME:
monorepo - A big home for small repos
USAGE:
monorepo [global options] command [command options] [arguments...]
VERSION:
0.0.0
AUTHOR(S):
Aaron O'Mullan <aaron@gitbook.com>
COMMANDS:
list, ls
pull
add
rm
GLOBAL OPTIONS:
--force Force action, may result in git force-pushes [$MONOREPO_FORCE]
--root value Path to the root of the monorepo [$MONOREPO_ROOT]
--help, -h show help
--version, -v print the version
- repos:
- path: folder1
url: https://github.com/org/repo1
ref: master
- path: folder2
url: https://github.com/org/repo2
ref: v2
monorepo
should never force push to your original repos (you can use the--force
flag if you chose to do so)