tags:

views:

16

answers:

1

I am using git add -i to select patch hunks to add or not.

I've learned using git by watching videos at http://gitcast.com. On their videos, I see that the patch output when using git add --interactive are coloured (on OSX?). When I do the same on my system (Linux/Kubuntu/bash), the patches are not colored (the usual shell colours, i.e. white/black).

How can I have a coloured output?

+1  A: 

In .gitconfig

[color]
  status = auto
  diff = auto

Your terminal will need to support colour, of course. There's more info here.

Brian Agnew
It worked like a charm! Thanks. I already had <code>[color] status = auto branch = auto</code> but was missing diff. Thanks.
augustin
Really, you should just use `color.ui` - it sets everything at once (though it can be overridden by specific settings like `color.status`).
Jefromi
@Jefromi. Yes, I just saw that in the link that Brian gave. I had looked earlier but missed that part of the documentation. I think I am all set, now. Thanks to both.
augustin