Force “git status” to output color on the terminal (inside a script)
To avoid changing your git config, you can enable colour just for the current command by passing a config variable with -c. For the status command, the variable is color.status: git -c color.status=always status | less -REX For diff, show, log and grep commands, the variable is color.ui: git -c color.ui=always diff | less -REX … Read more