mgit2.0.2
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:

mgit

Run 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:

  1. 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.
  2. A bare -- does the same thing, even for words that mgit would otherwise claim.
  3. So the --quiet in mgit log --quiet belongs to git, and the --quiet in mgit --quiet log belongs to mgit.
  4. mgit --version prints mgit's version. To ask git for its own, use mgit -- --version.

Try mgit -- --version: mgit -- --version

Options

OptionWhat it does
-h, --helpPrint the help and exit
-V, --versionPrint mgit's version and exit
-l, --listList 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, --quietDrop the per repository header and keep only git's own output
--color <WHEN>auto (default), always or never
--no-colorThe same as --color=never
--asciiASCII only glyphs, no emoji, for older terminals
--summaryAlways print the closing summary, and print it to stdout
-k, --keep-goingContinue after a failing repository (the default)
--fail-fastStop at the first repository that fails
--allow-emptyExit with 0 when no repository was found
--Everything that follows goes to git

Examples

CommandWhat it is for
mgit --listSee which directories would be touched, without running anything
mgit --depth 2 fetchReach repositories one level deeper as well
mgit -q log --oneline -n 1Quiet mode, one line of history per repository
mgit --fail-fast pullStop at the first conflict instead of collecting them
mgit --color=never statusTurn colour off for a file or a CI log
mgit --asciiPlain ASCII output for an older Windows console

Run it in the playground: mgit -q log --oneline -n 1