Colourless Git Output

I teach git and often have issues with bad projectors where you can't see the colours. Recently I had a setup where even white on black was more or less invisible, but using black text on a white background worked okay. There's lots of documentation on how to turn on colours in git but not so much about how to turn them off.

Try putting the following into .git/config:

[color]
    branch = false
    diff = false
    interactive = false
    status = false

I had expected to be able to set color.ui to false but that didn't seem to make much difference, so I now use the settings above. I thought I'd drop it here in case anyone else is looking for the same thing.

2 thoughts on “Colourless Git Output

  1. From the man page under "color.ui" (version 1.7.10.4):
    "This variable determines the default value for variables such as
    color.diff and color.grep that control the use of color per command
    family. Its scope will expand as more commands learn configuration
    to set a default for the --color option. Set it to always if you
    want all output not intended for machine consumption to use color,
    to true or auto if you want such output to use color when written
    to the terminal, or to false or never if you prefer git commands
    not to use color unless enabled explicitly with some other
    configuration or the --color option."

    So, setting it to false should do the trick, but maybe you have something that overrides it somewhere?

    • Yeah I think you are right and there is something strange about my setting, that's one reason why I shared what I actually had to do when the solution from the docs didn't work for me. I'll update if I find out what my strange config is!

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>