Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show git colors on Zsh?

Tags:

git

zsh

I recently started to use Zsh as my default shell. One thing that I like in git is the colors, for example, the git status and git diff used to have colors (additions in green, and deletions in red).

Now with Zsh it is all white (the default color). How can I put colors on git outputs in Zsh? Thanks.

like image 695
Migore Avatar asked Sep 03 '12 23:09

Migore


People also ask

Does git work with zsh?

git-prompt.sh is compatible with both Bash and Zsh. Zsh is powerful enough that there are entire frameworks dedicated to making it better.

How do I change git bash to zsh?

Add zsh packageExtract the content to your git bash installation dir: Usually C:\Program Files\Git using PeaZip. Now open git bash and type zsh, if it starts zsh then you are good to go.


2 Answers

git config --global color.diff auto
git config --global color.status auto

like image 158
marano Avatar answered Oct 17 '22 18:10

marano


Migore,

My .gitconfig is set up like this:

[color]
  diff = auto
  status = auto
  branch = auto
[color "status"]
  changed = yellow
  added = green
  untracked = red
like image 17
Pedro Nascimento Avatar answered Oct 17 '22 20:10

Pedro Nascimento