Recipes
Every block here can be pasted straight into a terminal, or tried in the playground first.
The morning check
mgit --listSee which directories today's commands will touch.
mgitThe state of every repository at once.
mgit pullUpdate everything; whatever failed is listed in the summary.
Run it in the playground: mgit pull
Only the repositories with changes
status --porcelain prints nothing for a clean repository, so with -q only the repositories that have something to say are left:
mgit -q status --porcelainDrop the -q when you need to know which repository each line came from: a clean one costs you a header and a blank line.
Switching branches in bulk
mgit branch --show-currentSee which branch each repository is on.
mgit checkout mainPut them all back on main; whatever could not switch shows up in the summary.
Run it in the playground: mgit branch --show-current
Finding what is behind
mgit fetch --all --pruneRefresh the remote information; this touches no working tree.
mgit -q log --oneline -n 1Then look at the newest commit in each repository.
A working directory with two levels
When the repositories live under work/team-a/* and work/team-b/*, reach one level further:
mgit --depth 2 --summaryTry it on a nested directory: mgit --depth 2 --summary
When not to use mgit
- When you need to pin the exact version of each dependency: that is what
git submoduleis for. - When you need one CI pipeline and one release: that is a monorepo question, not a multi repository one.
- When you need an atomic commit across repositories: mgit sends one command to each directory and offers no transaction of any kind.
mgit puts no files inside your repositories and changes no relationship between them. It does one thing: send the same command to every repository, then collect the results into one exit code.