- home :: github.com/rubycocos/git
- bugs :: github.com/rubycocos/git/issues
- gem :: rubygems.org/gems/monos
- rdoc :: rubydoc.info/gems/monos
- forum :: opensport
The mono
(or short mo
) command line tool lets you run
git commands on multiple repo(sitories) with a single command.
Use the MOPATH
environment variable to set the monorepo (single source tree) root
path. The builtin default for now is /sites
.
Add all repo(sitories) to the monorepo.yml
that you want
to be part of the "virtual" all-in-one / single mono source tree
in your project. Example:
sportdb:
- sport.db
- sport.db.sources
- football.db
yorobot:
- cache.csv
- sport.db.more
- football.db
- football.csv
openfootball:
- leagues
- clubs
status
• fetch
• sync
• run
• env
• backup
Use the status
command to check for changes (will use git status --short
) on all repos. Example:
$ mono status
$ mono # status is the default command
$ mo status # mo is a "shortcut" convenience alias for mono
$ mo stat
$ mo
resulting in something like:
2 change(s) in 9 repo(s) @ 3 org(s)
-- [email protected] - CHANGES:
M monos/Manifest.txt
M monos/README.md
M monos/Rakefile
M monos/lib/mono/git/status.rb
M monos/lib/mono/git/sync.rb
M monos/lib/mono/version.rb
RM monos/lib/monoscript.rb -> monos/lib/monos.rb
M monos/test/test_base.rb
?? monos/bin/
-- [email protected] - CHANGES:
?? footballdata/
Use the fetch
command to fetch all (remote) changes (will use git fetch
) on all existing repos and warn about not-yet-cloned repos. Example:
$ mono fetch
$ mo fetch # mo is a "shortcut" convenience alias for mono
Use the sync
command to sync up (pull) changes (will use git pull --ff-only
) on all existing repos and git clone
for new not-yet-cloned repos. Example:
$ mono sync
$ mono install # install is an alias for sync
$ mono get # get is another alias for sync
$ mo sync # mo is a "shortcut" convenience alias for mono
$ mo get
Note: install
or get
or up
are all aliases that you can use for sync
.
Use the run
command to run any command in all repos. Example:
$ mono run git ls-files
$ mono exec git ls-files # exec is an alias for run
$ mo run git ls-files # mo is a "shortcut" convenience alias for mono
$ mo exec git ls-files
# -or-
$ mono run tree
$ mono exec tree
$ mo run tree
$ mo exec tree
Note: exec
is an alias that you can use for run
.
Use the env
command to check your mono
environment setup.
Use the backup
command to backup all repos using
the gitti-backup
machinery »
In a nutshell backup will backup all repos by using
git clone --mirror
orgit remote update
(if the local backup already exists) and store all bare repos (without workspace) in the~/backup
directory.
That's all for now.
Use
gem install monos
The monos
scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.
Send them along to the Open Sports & Friends Forum/Mailing List. Thanks!