02 / 07
Commands and options
mgit only recognises the options in its own documentation. Everything else goes to git exactly as you typed it.
The default
With no arguments, mgit runs git status -s in every repository:
mgitRun it in the playground: mgit
Any git command
Everything from the first argument that is not an mgit option is handed to git untouched:
mgit pull
mgit fetch --all --prune
mgit log --oneline -n 3
mgit checkout main
mgit -c core.pager=cat status
The parsing rule
This is the only rule mgit asks you to remember. Everything after it is git's own behaviour:
- Arguments are read left to right. At the first one that is not an mgit option (
pull,-c,--git-dir, …), that argument and everything after it goes to git. - A bare
--does the same thing, even for words that mgit would otherwise claim. - So the
--quietinmgit log --quietbelongs to git, and the--quietinmgit --quiet logbelongs to mgit. mgit --versionprints mgit's version. To ask git for its own, usemgit -- --version.
Try mgit -- --version: mgit -- --version
Options
| Option | What it does |
|---|---|
-h, --help | Print the help and exit |
-V, --version | Print mgit's version and exit |
-l, --list | List the repositories that were found, one absolute path per line, and exit |
-d, --depth <N> | Search N directory levels down; the default is 1, direct subdirectories only |
-q, --quiet | Drop the per repository header and keep only git's own output |
--color <WHEN> | auto (default), always or never |
--no-color | The same as --color=never |
--ascii | ASCII only glyphs, no emoji, for older terminals |
--summary | Always print the closing summary, and print it to stdout |
-k, --keep-going | Continue after a failing repository (the default) |
--fail-fast | Stop at the first repository that fails |
--allow-empty | Exit with 0 when no repository was found |
-- | Everything that follows goes to git |
Examples
| Command | What it is for |
|---|---|
mgit --list | See which directories would be touched, without running anything |
mgit --depth 2 fetch | Reach repositories one level deeper as well |
mgit -q log --oneline -n 1 | Quiet mode, one line of history per repository |
mgit --fail-fast pull | Stop at the first conflict instead of collecting them |
mgit --color=never status | Turn colour off for a file or a CI log |
mgit --ascii | Plain ASCII output for an older Windows console |