This happens when you configure Git to always color diffs and/or all
of its output. The valid values for relevant Git variables
always, and the default is
You should leave it that because then you get colorful output in
terminals but git’s output is consumed by something else, then no
colors are used.
If you actually use some other tool which expects that requires that you force git to output control sequences (which is highly unlikely), then you can override these settings just for Magit by using:
(setq magit-git-global-arguments (nconc magit-git-global-arguments '("-c" "color.ui=false" "-c" "color.diff=false")))