mgit2.0.2
06 / 07

Environment and platforms

The differences between terminals are absorbed by the tool instead of being pushed onto you.

Environment variables

VariableWhat it does
MGIT_GITThe name or path of the git executable (default git)
MGIT_COLORauto, always or never; beats terminal detection
MGIT_ASCII1 forces the ASCII glyphs, 0 forces the Unicode ones
NO_COLORDisables colour when set to a non empty value
CLICOLOR_FORCEForces colour when set to something other than 0
CLICOLORDisables colour when set to 0
MGIT_VERSIONThe version the installer should fetch, for example 2.0.0
MGIT_INSTALL_DIRThe directory the installer should install into

Precedence: the command line, then MGIT_*, then CLICOLOR_FORCE, then NO_COLOR, then terminal detection.

Try the precedence: CLICOLOR_FORCE=1 NO_COLOR=1 mgit --summary

Platform behaviour

SituationBehaviour
Output redirected (pipe, file, CI log)colour off, plain text only
Windows cmd.exe / Windows PowerShell 5.1virtual terminal mode is enabled at startup so ANSI works; colour is disabled when it cannot be
A Windows console whose code page is not UTF-8ASCII glyphs, so the emoji cannot turn into noise
PowerShell 7, Windows Terminal, macOS, Linuxthe Unicode glyphs
A POSIX locale that is not UTF-8 (LANG=C)ASCII glyphs; MGIT_ASCII=0 forces Unicode back
mgit … | headthe default SIGPIPE behaviour is restored, so a closed pipe ends the run quietly
git on Windowsfound through PATH (including PATHEXT); MGIT_GIT can point at a full path

The "where the output goes" control in the playground switches between these situations, so you can watch the same command change.

Switch the output target and run it again: mgit --summary

When git is missing

mgit checks that git can be started before it does anything. When it cannot, mgit prints one error with the install hint for that platform and exits with 127.

Press "Remove git" first, then run it: mgit